home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / msdos-programmer-faq.faq < prev    next >
Encoding:
Internet Message Format  |  1994-05-04  |  129.9 KB

  1. Subject: comp.os.msdos.programmer FAQ
  2. Newsgroups: comp.os.msdos.programmer,comp.answers,news.answers
  3. From: brown@ncoast.org
  4. Date: Sun, 1 May 1994 22:20:48 GMT
  5.  
  6. Archive-name: msdos-programmer-faq/faq
  7. Comp-os-msdos-programmer-archive-name: dos-faq
  8. Posting-frequency: monthly
  9. Last-modified: 1 May 1994
  10.  
  11. Copyright (C) 1994  Stan Brown, Oak Road Systems.  All rights reserved.
  12. This article is not in the public domain, but it may be redistributed so
  13. long as this notice, the acknowledgments, and the information on
  14. obtaining the latest copy of this list are retained and no fee is
  15. charged.  The code fragments may be used freely; credit would be polite.
  16.  
  17.     Special note:  Maintenance on this file is minimal because I have
  18.     limited time (and, lately, limited interest) in this area.  Someone
  19.     with a more active interest in DOS programming could do the net a
  20.     great service by taking over this list; send me email if interested.
  21.  
  22.  
  23. Subject:  Table of Contents
  24.  
  25. section 0. Introduction to this article
  26.     001. What is this article? (rev: 19 Apr 1994)
  27.     002. Why is this article? (rev: 20 Mar 1994)
  28.     003. How can I search this article for a particular topic? (rev: 20
  29.          Mar 1994)
  30.     004. Who has contributed to this article?
  31.     005. Are the answers guaranteed correct and complete? (rev: 20 Mar
  32.          1994)
  33. section 1. General questions
  34.     101. Why won't my code work?
  35.     102. What is this newsgroup about? (rev: 11 Sep 1993)
  36.     103. Is comp.os.msdos.programmer just for C programmers? (rev: 20
  37.          Mar 1994)
  38.     104. What's the difference from comp.sys.ibm.pc.programmer?
  39.     105. Is comp.os.msdos.programmer available as a mailing list? (new:
  40.          2 Feb 1993)
  41.     106. What's this "netiquette"? (rev: 20 Mar 1994)
  42.     107. How can I learn more about Usenet? (new: 7 Aug 1993)
  43.     108. What other technical newsgroups should I know about? (rev: 6
  44.          Apr 1994)
  45. section 2. Compile and link
  46.     201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  47.     202. How do I fix "automatic data segment exceeds 64K" or "stack
  48.          plus data exceed 64K"?
  49.     203. Will Borland C code and Microsoft C code link together? (rev:
  50.          15 Aug 1993)
  51.     204. Why did my program bomb at run time with "floating point
  52.          formats not linked" or "floating point not loaded"? (rev: 20
  53.          March 1994)
  54.     205. How can I change the stack size in Borland's C compilers? (rev:
  55.          24 March 1994)
  56.     206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  57.     207. What's the format of an .EXE header?
  58.     208. What's the difference between .COM and .EXE formats?
  59. section 3. Keyboard
  60.     301. How can I read a character without echoing it to the screen,
  61.          and without waiting for the user to press the Enter key?
  62.     302. How can I find out whether a character has been typed, without
  63.          waiting for one?
  64.     303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del? (rev:
  65.          11 Sep 1993)
  66.     304. How can I disable the print screen function?
  67.     305. How can my program turn NumLock (CapsLock, ScrollLock) on or
  68.          off?
  69.     306. How can I speed up the keyboard's auto-repeat? (rev: 24 Mar
  70.          1994)
  71.     307. What is the SysRq key for?
  72.     308. How can my program tell what kind of keyboard is on the system?
  73.     309. How can I tell if input, output, or stderr has been redirected?
  74.          (rev: 24 Mar 1994)
  75.     310. How can I increase the size of the keyboard buffer? (new: 20
  76.          June 1993)
  77.     311. How can I stuff characters into the keyboard buffer? (new: 15
  78.          Aug 1993)
  79. section 4. Disks and files
  80.     401. What drive was the PC booted from?
  81.     402. How can I boot from drive b:? (rev: 24 Mar 1994)
  82.     403. Which real and virtual disk drives are valid? (rev: 15 Aug
  83.          1993)
  84.     404. How can I make my single floppy drive both a: and b:?
  85.     405. How can I disable access to a drive? (new: 15 Aug 1993)
  86.     406. How can a batch file test existence of a directory? (rev: 8 Apr
  87.          1994)
  88.     407. Why won't my C program open a file with a path?
  89.     408. How can I redirect printer output to a file? (rev: 16 Aug 1993)
  90.     409. How can I redirect the output of a batch file? (rev: 24 Mar
  91.          1994)
  92.     410. How can I redirect stderr? (rev: 24 Mar 1994)
  93.     411. How can my program open more files than DOS's limit of 20?
  94.          (rev: 12 Sep 1993)
  95.     412. How can I read, create, change, or delete the volume label?
  96.     413. How can I get the disk serial number?
  97.     414. What's the format of .OBJ, .EXE., .COM files?
  98.     415. How can I flush the software disk cache?
  99. section 5. Serial ports (COM ports)
  100.     501. How do I set my machine up to use COM3 and COM4?
  101.     502. How do I find the I/O address of a COM port? (rev: 24 Mar 1994)
  102.     503. But aren't the COM ports always at I/O addresses 3F8, 2F8, 3E8,
  103.          and 2E8?
  104.     504. How do I configure a COM port and use it to transmit data?
  105.          (rev: 17 Sep 1993)
  106. section 6. Other hardware questions and problems
  107.     601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  108.     602. How can a C program send control codes to my printer?
  109.     603. How can I redirect printer output to a file?
  110.     604. Which video adapter is installed?
  111.     605. How do I switch to 43- or 50-line mode?
  112.     606. How can I find the Microsoft mouse position and button status?
  113.     607. How can I access a specific address in the PC's memory? (rev:
  114.          24 March 1994)
  115.     608. How can I read or write my PC's CMOS memory? (rev: 24 Mar 1994)
  116.     609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  117. section 7. Other software questions and problems
  118.     701. How can a program reboot my PC? (rev: 24 Mar 1994)
  119.     702. How can I time events with finer resolution than the system
  120.          clock's 55 ms (about 18 ticks a second)? (rev: 24 Mar 1994)
  121.     703. How can I find the error level of the previous program? (rev:
  122.          24 Mar 1994)
  123.     704. How can a program set DOS environment variables? (rev: 24 Mar
  124.          1994)
  125.     705. How can I change the switch character to - from /? (rev: 20 Mar
  126.          1994)
  127.     706. Why does my interrupt function behave strangely? (rev: 24 Sep
  128.          1993)
  129.     707. How can I write a TSR (terminate-stay-resident utility)? (rev:
  130.          24 Mar 1994)
  131.     708. How can I write a device driver?
  132.     709. What can I use to manage versions of software? (rev: 21 Aug
  133.          1993)
  134.     710. What's this "null pointer assignment" after my C program
  135.          executes? (rev: 20 Mar 1994)
  136.     711. How can a batch file tell whether it's being run in a DOS box
  137.          under Windows? (new: 20 Mar 1994)
  138.     712. How can my program tell if it's running under Windows? (rev: 20
  139.          Mar 1994)
  140.     713. How can a program tell whether ANSI.SYS is installed? (new: 20
  141.          Apr 1994)
  142.     799. How do I copyright software that I write? (rev: 9 Sep 1993)
  143. section A. Downloading
  144.     A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  145.     A02. I have no ftp access.  How can I get files from the archives?
  146.          (rev: 14 June 1993)
  147.     A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  148.     A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  149.     A05. How can I check SimTel or Garbo before I post a request for a
  150.          program? (rev: 24 Mar 1994)
  151.     A06. How do I download and decode a program I found? (rev: 7 Aug
  152.          1993)
  153.     A07. Where is UUDECODE?
  154.     A08. Why do I get errors when extracting from a ZIP file I
  155.          downloaded? (rev: 20 Mar 1994)
  156. section B. Vendors and products
  157.     B01. How can I contact Borland? (rev: 6 Sep 1993)
  158.     B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  159.     B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  160.     B04. What is the phone number for a vendor's BBS? (rev: 24 Mar 1994)
  161. section C. More information
  162.     C01. Are there any good on-line references for PC hardware
  163.          components? (rev: 28 July 1993)
  164.     C02. Are there any good on-line references for PC interrupts?
  165.     C03. What and where is "Ralf Brown's interrupt list"? (rev: 5 Apr
  166.          1994)
  167.     C04. Where can I find lex, yacc, and language grammars?
  168.     C05. What's the best book to learn programming?
  169.     C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  170.     C07. Where can I get the latest copy of this FAQ list? (rev: 30 Mar
  171.          1994)
  172.     C08. How do I use ftp? (rev: 6 Apr 1994)
  173.  
  174.  
  175. section 0. Introduction to this article
  176. =======================================
  177.  
  178. Subject:  001. What is this article? (rev: 19 Apr 1994)
  179.  
  180.     This is the FAQ list (Frequently Asked Questions list) for the
  181.     newsgroup comp.os.msdos.programmer.  Starting 2 Feb 1993, new
  182.     questions and questions with revised answers are marked with "new:"
  183.     or "rev:" and the change date.  A separate article, containing just
  184.     the changes, is posted with subject line "comp.os.msdos.programmer
  185.     FAQ diffs".
  186.  
  187.     If the posting date shown above is much more than a month in the
  188.     past, see "C07. Where can I get the latest copy of this FAQ list?"
  189.  
  190. Subject:  002. Why is this article? (rev: 20 Mar 1994)
  191.  
  192.     FAQ lists are intended to reduce the noise level in their newsgroups
  193.     that results from the repetition of the same questions, correct
  194.     answers, wrong answers, corrections to the wrong answers,
  195.     corrections to the corrections, debate, etc.
  196.  
  197.     This list should serve as a repository of the canonical "best"
  198.     answers to the questions in it.  The names of folks who have helped
  199.     to improve this FAQ list are listed in "004. Who has contributed to
  200.     this article?"
  201.  
  202. Subject:  003. How can I search this article for a particular topic?
  203.                (rev: 20 Mar 1994)
  204.  
  205.     This list is in digest format.
  206.  
  207.     To skip one topic and go to the next:  Search for "Subject" starting
  208.     in column 1.  In trn and similar newsreaders, the command
  209.     "g^Subject", or a simple Ctrl-G, does that.
  210.  
  211.     To search for specific topics:  In the Table of Contents (above),
  212.     locate the question you need.  Then search for that question number.
  213.     For example, while you're reading this list, the trn newsreader
  214.     command "g  203" (note the two spaces) goes to question 203.
  215.  
  216.     If your newsreader doesn't support searches, you can extract these
  217.     articles to a file and use your favorite editor's search commands.
  218.  
  219. Subject:  004. Who has contributed to this article?
  220.  
  221.     This list is edited by Stan Brown, Oak Road Systems, Cleveland,
  222.     Ohio, the "I" or "me" in some answers.
  223.  
  224.     Many articles posted in comp.os.msdos.programmer sparked ideas or
  225.     provided information for the first version of this list.  Though
  226.     they are not responsible for any errors, thanks are due to the
  227.     following persons for posted articles or private email that led to
  228.     improvements in this FAQ list:
  229.  
  230.     Jamshid Afshar, Mark Aitchison, Sanjay Aiyagari, George Almasi,
  231.     Aaron Auseth, Robert Baker, Preston Bannister, Scott Barman, Denis
  232.     Beauregard, Per Bergland, Mike Black, Chris Blum, Ron Bodkin, Mark
  233.     Brader, Jon Brinkmann, Andrew James Bromage, Glynn Brooks, Paul
  234.     Brooks, Ralf Brown, Shaun Burnett, Raymond Chen, Denny de Jonge,
  235.     Eric DeVolder, Alan Drew, Paul Ducklin, Gary Dueck, Roland Eriksson,
  236.     Mark Evans, Markus Fischer, George Forsman, Roger Fulton, Vincent
  237.     Giovannone, Robert Grunloh, B.Haible, Janos Haide, Klaus Hartnegg,
  238.     Kris Heidenstrom, Tom Haapanen, Joel Hoffman, Ari Hovila, Chin
  239.     Huang, Joe Huffman, Michael Holin, Mike Iarrobino, Byrial Jensen,
  240.     Rune Jorgensen, Ajay Kamdar, Everett Kaser, Jeff Kellam, Jen Kilmer,
  241.     Reinhard Kirchner, Dave Kirsch, Chad Knudsen, Samuel Ko, Benjamin
  242.     Lee, Stephen Lee, Jim Lynch, Greg Malknecht, Sidney Markowitz, Jim
  243.     Marks, Dimitri Matzarakis, Fred McCall, Ken McKee, Doug Merrett, Tom
  244.     Milner, Bill Moore, Duncan Murdoch, Steve Murphy, Daniel Neri, Mert
  245.     Nickerson, David Nugent, John Oldenburg, David Pape, Keith Petersen,
  246.     Karl Riedling, Arthur Rubin, Gerald Ruderman, Timo Salmi, Tapio
  247.     Sand, John Schmid, Russell Schulz, Huseyin Sevay, Ajay Shah, Bob
  248.     Smith, Steve Summit, Tom Swingle, Anders Thulin, Curt Tilmes, Rick
  249.     Watkins, Ya-Gui Wei, Joe Wells, Scott Winder, Gregory Youngblood,
  250.     khill@vax1.umkc.edu
  251.  
  252.     New contributor: Bob Smith
  253.  
  254. Subject:  005. Are the answers guaranteed correct and complete? (rev: 20
  255.                Mar 1994)
  256.  
  257.     I've tried to check all facts, but THERE IS NO WARRANTY ON THE CODE
  258.     OR ON THE TECHNIQUES DESCRIBED HEREIN.  Please send corrections to
  259.     brown@ncoast.org.  All the code has been tested; but the testing may
  260.     not have been perfect, and machines and configurations vary.
  261.     (Except where otherwise noted, C code was tested with both BC++ 2.0
  262.     and MSC 5.0.)
  263.  
  264.     The mention of particular books or programs must not be construed to
  265.     reflect unfavorably on any that are not mentioned.
  266.  
  267.  
  268. section 1. General questions
  269. ============================
  270.  
  271. Subject:  101. Why won't my code work?
  272.  
  273.     First you need to try to determine whether the problem is in your
  274.     use of the programming language or in your use of MS-DOS and your PC
  275.     hardware.  (Your manual should tell you which features are standard
  276.     and which are vendor- or MS-DOS- or PC-specific.  You _have_ read
  277.     your manual carefully, haven't you?)
  278.  
  279.     If the feature that seems to be working wrong is something related
  280.     to your PC hardware or to the internals of MS-DOS, this group is the
  281.     right place to ask.  (Please check this FAQ list first, to make sure
  282.     your question isn't already answered here.)
  283.  
  284.     On the other hand, if your problem is with the programming language,
  285.     the comp.lang hierarchy (including comp.lang.pascal and comp.lang.c)
  286.     is probably a better resource.  Please read the other group's FAQ
  287.     list thoroughly before posting.  (These exist in comp.lang.c,
  288.     comp.lang.c++, comp.lang.modula3, comp.lang.lisp, comp.lang.perl;
  289.     they may exist in other groups as well.)  It's almost never a good
  290.     idea to crosspost between comp.os.msdos.programmer and a language
  291.     group.
  292.  
  293.     Before posting in either place, try to make your program as small as
  294.     possible while still exhibiting the bad behavior.  Sometimes this
  295.     alone is enough to show you where the trouble is.  Also edit your
  296.     description of the problem to be as short as possible.  This makes
  297.     it look more like you tried to solve the problem on your own, and
  298.     makes people more inclined to try to help you.  See also "106.
  299.     What's this "netiquette"?"
  300.  
  301. Subject:  102. What is this newsgroup about? (rev: 11 Sep 1993)
  302.  
  303.     comp.os.msdos.programmer (comp.sys.ibm.pc.programmer until September
  304.     1990) concerns programming for MS-DOS systems.  The article "USENET
  305.     Readership report for Aug 93" in news.lists shows 78,000 readers of
  306.     this newsgroup worldwide.  Traffic (exclusive of crossposts) was 813
  307.     articles aggregating 1604 Kbytes.
  308.  
  309.     Much of our traffic is about language products (chiefly from Borland
  310.     and Microsoft).  More programming topics focus on C than on any one
  311.     other language, but we are not just for C programmers (see "103. Is
  312.     comp.os.msdos.programmer just for C programmers?").
  313.  
  314.     Since most MS-DOS systems run on hardware that is roughly compatible
  315.     with the IBM PC, on Intel 8088, 80188, or 80x86 chips, we tend to
  316.     get a lot of questions and answers about programming other parts of
  317.     the hardware.
  318.  
  319. Subject:  103. Is comp.os.msdos.programmer just for C programmers? (rev:
  320.                20 Mar 1994)
  321.  
  322.     No, it is for all programmers who want to share information about
  323.     programming in MS-DOS and DOS replacements like 4DOS.  Programs and
  324.     questions are also posted in Pascal, assembly, and other languages
  325.     (including MS-DOS batch programming.)
  326.  
  327.     Why does the newsgroup seem to be so C-oriented sometimes?  There
  328.     are two reasons.  First, comp.lang.c and comp.lang.pascal have
  329.     evolved in different directions.  comp.lang.pascal welcomes vendor-
  330.     specific discussion, such as Turbo Pascal.  Since so many of TP's
  331.     features are tailored to programming on PCs and in MS-DOS, Turbo
  332.     Pascal programmers tend to find DOS questions welcomed there, so
  333.     that comp.os.msdos.programmer gets less of the "DOS in Turbo Pascal"
  334.     traffic.  On the other hand, comp.lang.c has stayed closer to
  335.     talking only about the C language, and vendor-specific or operating-
  336.     system-specific questions are not welcome.  This tends to push
  337.     questions about disks, DOS file structure, video, the keyboard,
  338.     TSRs, etc. to comp.os.msdos.programmer even when those programs are
  339.     written in C.
  340.  
  341.     This FAQ is definitely C-oriented, not because that's necessarily
  342.     best but because I tried to stick to what I could verify personally.
  343.     As a C programmer (with some assembler), I could most carefully
  344.     verify solutions in C or assembler.  I felt that short, clear
  345.     programs could be published in just one language and programmers
  346.     could translate them into their languages of choice.  But the FAQ
  347.     list also contains several long programs written only in C; this is
  348.     a defect with no obvious remedy.  Most answers that point to source
  349.     code at archive sites include both C- and Pascal-language source
  350.     when available.
  351.  
  352. Subject:  104. What's the difference from comp.sys.ibm.pc.programmer?
  353.  
  354.     c.s.i.p.programmer is the old name of comp.os.msdos.programmer, and
  355.     has been obsolete since September 1990.  However, many systems have
  356.     not removed the old group, or have removed it but aliased it to the
  357.     new name.  This means that some people still think they're posting
  358.     to c.s.i.p.programmer even though they're actually posting to
  359.     comp.os.msdos.programmer.
  360.  
  361.     You can easily verify the non-existence of c.s.i.p.programmer by
  362.     reference to the "List of Active Newsgroups" posted to news.groups.
  363.     It's available as /pub/usenet/news.answers/active-newsgroups/part1
  364.     from the archives (see "C06. Where are FAQ lists archived?").
  365.  
  366. Subject:  105. Is comp.os.msdos.programmer available as a mailing list?
  367.                (new: 2 Feb 1993)
  368.  
  369.     Sorry, no.
  370.  
  371. Subject:  106. What's this "netiquette"? (rev: 20 Mar 1994)
  372.  
  373.     Netiquette is good Usenet etiquette.  It includes basic rules like
  374.     the ones below.  (See also "107. How can I learn more about
  375.     Usenet?")
  376.  
  377.     - Always read a newsgroup for a reasonable time before you post an
  378.       article to it.
  379.  
  380.     - Pick the one right group for your article; don't crosspost unless
  381.       absolutely necessary.  If you absolutely must post an article to
  382.       more than one group, do crosspost it and don't post the same
  383.       article separately to each group.  See "108. What other technical
  384.       newsgroups should I know about?" when considering where to post an
  385.       article.
  386.  
  387.     - Before you post a question, make sure you're posting to the right
  388.       newsgroup; the best way to do that is to observe the preceding
  389.       rule.  Check the group's FAQ list (if it has one) to make sure
  390.       that your question isn't already answered there; see "C06. Where
  391.       are FAQ lists archived?".
  392.  
  393.     - When you post a question, if you ask for email responses then
  394.       promise to post a summary.  Keep your promise.  And make it a real
  395.       summary: don't just append all the email you got.  Instead, write
  396.       your own (brief) description of the solution:  this is the best
  397.       way to make sure you really understand it.
  398.  
  399.     - Before you post a follow-up, read the other follow-ups.  Very
  400.       often you'll find that someone else has already made the point you
  401.       had in mind.
  402.  
  403.     - When someone posts a question, if you want to know the answer
  404.       don't post a "me, too".  Instead send email to the poster asking
  405.       him or her to share responses with you.
  406.  
  407.     - When posting a follow-up to another posted article, remove all
  408.       headers and signature lines from the old article; just keep the
  409.       line "In <article>, so-and-so writes:".  Also cut the original
  410.       article down as much as possible; just keep enough of it to remind
  411.       readers of the context.
  412.  
  413.     - Keep lines in posted articles to 72-75 characters.  Many
  414.       newsreaders chop off column 81 or arbitrarily insert a newline
  415.       there, which makes longer lines difficult or impossible to read.
  416.       But you need to keep well below 80 characters per line to allow
  417.       for the > characters that get inserted when other people post
  418.       follow-ups to your article.
  419.  
  420.     - Keep your signature to 4 lines or less (including any graphics),
  421.       and for heaven's sake make sure it doesn't get posted twice in
  422.       your article.
  423.  
  424.     - Don't post email without first obtaining the permission of the
  425.       sender.
  426.  
  427. Subject:  107. How can I learn more about Usenet? (new: 7 Aug 1993)
  428.  
  429.     There are two important newsgroups for learning about how Usenet and
  430.     newsreader software works:
  431.  
  432.     - news.announce.newusers contains periodic postings that everybody
  433.       is asked to read before posting anything to Usenet.  (In theory,
  434.       all new users are subscribed to news.announce.newusers
  435.       automatically.  But in practice not all newsreader software does
  436.       that, so that many people violate the guidelines given there
  437.       simply because they don't know about them.)
  438.  
  439.     - news.newusers.questions is described as "Q & A for users new to
  440.       the Usenet".  But new and long-time users can ask or answer
  441.       questions about Usenet and newsreader software there.  There's an
  442.       important article, "Welcome to news.newusers.questions! (weekly
  443.       posting)", that everyone is asked to read before posting to
  444.       news.newusers.questions.  (See below for ways to get a copy of
  445.       that article.)
  446.  
  447.     The following postings in news.announce.newusers might be considered
  448.     the "mandatory course" for new users:
  449.  
  450.         Introduction to news.announce.newusers
  451.         What is Usenet?
  452.         Answers to Frequently Asked Questions
  453.         Rules for posting to Usenet
  454.         A Primer on How to Work With the Usenet Community
  455.         Hints on writing style for Usenet
  456.         Emily Postnews Answers Your Questions on Netiquette
  457.  
  458.     The articles mentioned above are downloadable via ftp from
  459.     rtfm.mit.edu in the following files:
  460.  
  461.         /pub/usenet/news.answers/news-newusers-intro
  462.             Welcome to news.newusers.questions! (weekly posting)
  463.         /pub/usenet/news.answers/news-announce-intro/part1
  464.             Introduction to news.announce.newusers
  465.         /pub/usenet/news.answers/what-is-usenet/part1
  466.             What is Usenet?
  467.         /pub/usenet/news.answers/usenet-faq/part1
  468.             Answers to Frequently Asked Questions
  469.         /pub/usenet/news.answers/posting-rules/part1
  470.             Rules for posting to Usenet
  471.         /pub/usenet/news.answers/usenet-primer/part1
  472.             A Primer on How to Work With the Usenet Community
  473.         /pub/usenet/news.answers/usenet-writing-style/part1
  474.             Hints on writing style for Usenet
  475.         /pub/usenet/news.answers/emily-postnews/part1
  476.             Emily Postnews Answers Your Questions on Netiquette
  477.  
  478.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  479.     archived?"
  480.  
  481. Subject:  108. What other technical newsgroups should I know about?
  482.                (rev: 6 Apr 1994)
  483.  
  484.     Caution:  Some of these newsgroups have specialized charters; you'll
  485.     probably get flamed (and deserve it) if you post to an inappropriate
  486.     group.  Most groups have FAQ lists that will tell you what's
  487.     appropriate.  Don't post a request for the FAQ list; instead,
  488.     retrieve it yourself: see "C06. Where are FAQ lists archived?"
  489.  
  490.     - misc.forsale.computers.d and misc.forsale.computers.pc-clone are
  491.       where you post notices of equipment, software, or computer books
  492.       that you want to sell.  Please don't post or crosspost those
  493.       notices to comp.os.msdos.programmer.
  494.  
  495.     - comp.os.ms-windows.programmer.* groups (formerly part of
  496.       comp.windows.ms.programmer):  Similar to comp.os.msdos.programmer,
  497.       but focus on programming for the MS-Windows platform.
  498.  
  499.     - comp.sys.ibm.pc.hardware is for more hardware-oriented discussions
  500.       of the machines that run DOS.
  501.  
  502.     - the various comp.lang.* groups for articles and questions on the
  503.       programming languages.  Caution:  some groups welcome discussions
  504.       that are operating-system dependent or vendor specific; others do
  505.       not.  For example, comp.lang.c is definitely _not_ for questions
  506.       about programming DOS or PC system features, even if the programs
  507.       are written in C.  On the other hand, comp.lang.pascal contains
  508.       much discussion that is specific to Turbo Pascal.
  509.  
  510.     - comp.binaries.ibm.pc.wanted: AFTER you have looked in the other
  511.       groups, this is the place to post a request for a particular
  512.       binary program.
  513.  
  514.     - comp.archives.msdos.announce (moderated) explains how to use the
  515.       archive sites, especially Garbo and SimTel, and lists files
  516.       uploaded to them.  Discussions belong in comp.archives.msdos.d,
  517.       which replaced comp.binaries.ibm.pc.archives in December 1992.
  518.  
  519.     - MSDOS-Ann mailing list, for those who cannot subscribe to the
  520.       comp.archives.msdos.announce newsgroup, lists SimTel and Garbo
  521.       uploads in digest format.  Instructions are downloadable as
  522.  
  523.         /pc/MSDOSANN.ZIP from Garbo
  524.         /pub/msdos/info/msdosann.zip from SimTel.
  525.  
  526.     - comp.binaries.ibm.pc.d is for discussions about programs posted in
  527.       comp.binaries.ibm.pc, and only those programs.  This is a good
  528.       place to report bugs in the programs, but not to ask where to find
  529.       them (see cbip.wanted, above).  cbip.d is NOT supposed to be a
  530.       general PC discussion group.
  531.  
  532.     - comp.sources.misc: a moderated group for source code for many
  533.       computer systems.  It tends to get lots of Unix stuff, but you may
  534.       also pick up some DOS-compatible code here.
  535.  
  536.     - alt.sources: an unmoderated group for source code.  Guidelines are
  537.       posted periodically.
  538.  
  539.     - comp.os.msdos.programmer.turbovision is specifically for
  540.       programming in Turbo Vision.
  541.  
  542.  
  543. section 2. Compile and link
  544. ===========================
  545.  
  546. Subject:  201. What the heck is "DGROUP > 64K"? (rev: 18 Apr 1993)
  547.  
  548.     This Q explains the problem; the next Q gives some remedies.
  549.  
  550.     DGROUP is a link-time group of data segments, and the compiler
  551.     typically generates code that expects DS to be pointing to DGROUP.
  552.     (Exception:  Borland's huge model has no DGROUP.)
  553.  
  554.     Here's what goes into DGROUP:
  555.  
  556.     - tiny model (all pointers near):  DGROUP holds the entire program.
  557.  
  558.     - small and medium models (data pointers near):  DGROUP holds all
  559.       globals and static variables including string literals, plus the
  560.       stack and the heap.
  561.  
  562.     - large, compact, and huge models in Microsoft (data pointers far):
  563.       DGROUP holds only initialized globals and static variables
  564.       including string literals, plus the stack and the near heap.
  565.  
  566.     - large and compact models in Borland (data pointers far): DGROUP
  567.       holds initialized and uninitialized globals and static variables
  568.       including string literals, but not the stack or heap.
  569.  
  570.     - huge model in Borland (data pointers far): there is no DGROUP, so
  571.       the 64K limit doesn't apply.
  572.  
  573.     In all of the above, which is to say all six models in Microsoft C
  574.     and all but huge in Borland C, DGROUP is limited to 64K including
  575.     string literals (which are treated as static data).  This limitation
  576.     is due to the Intel CPU's segmented architecture.
  577.  
  578.     For more information, see topics like "memory models" and "memory
  579.     management" in the index of your compiler manual.  Also see
  580.     TI738.asc, downloadable as part of
  581.  
  582.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  583.         /pc/turbopas/bchelp10.zip at Garbo,
  584.  
  585.     for an extended general discussion of memory usage in Borland C
  586.     programs, of which much applies to any C compiler in DOS.
  587.  
  588. Subject:  202. How do I fix "automatic data segment exceeds 64K" or
  589.                "stack plus data exceed 64K"?
  590.  
  591.     These messages are a variation of "DGROUP > 64K".  For causes,
  592.     please see the preceding Q.
  593.  
  594.     If you get this error in tiny model, your program is simply too big
  595.     and you must use a different memory model.  If you get this link
  596.     error in models S, C, M, L, or Microsoft's H, there are some things
  597.     you can do.  (This error can't occur in Borland's huge model.)
  598.  
  599.     If you have one or two big global arrays, simply declare them far.
  600.     The compiler takes this to mean that any references to them will use
  601.     32-bit pointers, so they'll be in separate segments and no longer
  602.     part of DGROUP.
  603.  
  604.     Or you can use the /Gt[number] option with Microsoft or -Ff[=size]
  605.     with Borland C++ 2.0 and up.  This will automatically put variables
  606.     above a certain size into their own segments outside of DGROUP.
  607.  
  608.     Yet another option is to change global arrays to far pointers.  Then
  609.     at the beginning of your program, allocate them from the far heap
  610.     (_fmalloc() in Microsoft, farmalloc() in Borland).
  611.  
  612.     Finally, you can change to huge model (with Borland compilers, not
  613.     Microsoft).  Borland's H model still uses far pointers by default,
  614.     but "sets aside the [64K] limit" and has no DGROUP group, according
  615.     to the BC++ 2.0 Programmer's Guide.  Microsoft's H model does use
  616.     huge data pointers by default but retains DGROUP and its 64K limit,
  617.     so switching to the H model doesn't buy you anything if you have
  618.     DGROUP problems.
  619.  
  620. Subject:  203. Will Borland C code and Microsoft C code link together?
  621.                (rev: 15 Aug 1993)
  622.  
  623.     Typically this question is asked by someone who owns compiler A and
  624.     is trying to write code to link with a third-party library that was
  625.     compiled under compiler B.
  626.  
  627.     The answer to the question is, Not in general.  Here are some of the
  628.     reasons:
  629.  
  630.     - "Helper" functions (undocumented functions for stack checking,
  631.       floating-point arithmetic, and operations on longs) differ between
  632.       the two compilers.
  633.  
  634.     - The compilers may embed instructions in the object code that tell
  635.       the linker to look for their own run-time libraries.  You can use
  636.       the linker option that says to ignore such instructions: /n in
  637.       TLINK, /NOD in the Microsoft linker (the one that comes with the C
  638.       compiler, not the one that used to come with DOS).  But getting
  639.       around this problem will very likely just reveal other problems,
  640.       like different helper functions, that have no easy solution.
  641.  
  642.     Those problems will generate link-time errors.  Others may not show
  643.     up until run time:
  644.  
  645.     - Borland's compact, large, and huge models don't assume DS=SS, but
  646.       Microsoft's do.  The -Fs option on the Borland compiler, or one of
  647.       the /A options on Microsoft, should take care of this problem--
  648.       once you know that's what's going on.
  649.  
  650.     - Check conventions for ordering and packing structure members, and
  651.       for alignment of various types on byte, word, paragraph, or other
  652.       boundaries.  Again, you can generally adjust your code to match if
  653.       you know what conventions were used in compiling the "foreign"
  654.       libraries.
  655.  
  656.     - Check the obvious and make sure that your code was compiled under
  657.       the same memory model as the code you're trying to link with.
  658.       (That's necessary, but no guarantee.  Microsoft and Borland don't
  659.       use exactly the same conventions for segments and groups,
  660.       particularly in the larger memory models.)
  661.  
  662.     That said, there are some circumstances where you can link hybrids.
  663.     Your best chance of success comes if you compile in large model with
  664.     the compiler switch that says to reload DS on entry to each
  665.     function, avoid longs and floating point, use only 16-bit pointers,
  666.     suppress stack checking, and specify all libraries used in the link.
  667.  
  668. Subject:  204. Why did my program bomb at run time with "floating point
  669.                formats not linked" or "floating point not loaded"? (rev:
  670.                20 March 1994)
  671.  
  672.     These messages look similar but have very different causes.
  673.  
  674.     "floating point not loaded" is Microsoft C's run-time message when
  675.     the code requires a numeric coprocessor but your computer doesn't
  676.     have one installed.  If the program is yours, relink it using the
  677.     xLIBCE or xLIBCA library (where x is the memory model).
  678.  
  679.     "floating point formats not linked" is a Borland run-time error
  680.     (Borland C or C++, Turbo C or C++).  Borland's compilers try to be
  681.     smart and not link in the floating-point (f-p) library unless you
  682.     need it.  Alas, they all get the decision wrong.  One common case is
  683.     where you don't call any f-p functions, but you have %f or other f-p
  684.     formats in scanf() or printf() calls.  The cure is to call an f-p
  685.     function, or at least force one to be present in the link.
  686.  
  687.     To do that, define this function somewhere in a source file but
  688.     don't call it:
  689.  
  690.         static void forcefloat(float *p) {
  691.             float f = *p;
  692.             forcefloat(&f);
  693.         }
  694.  
  695.     It doesn't have to be in the module with the main program, as long
  696.     as it's in a module that will be included in the link.
  697.  
  698.     If you have Borland C++ 3.0, the README file documents a slightly
  699.     less ugly work-around.  Insert these statements in your program:
  700.  
  701.         extern unsigned _floatconvert;
  702.         #pragma extref _floatconvert
  703.  
  704. Subject:  205. How can I change the stack size in Borland's C compilers?
  705.                (rev: 24 March 1994)
  706.  
  707.     In Turbo C, Turbo C++, and Borland C++, you may not find "stack
  708.     size" in the index but the global variable _stklen should be there.
  709.     The manual will instruct you to put a statement like
  710.  
  711.         extern unsigned _stklen = 54321U;
  712.  
  713.     in your code, outside of any function.  You must assign the value
  714.     right in the extern statement; it won't work to assign a value at
  715.     run time.  The linker may give you a duplicate symbol warning, which
  716.     you can ignore.
  717.  
  718. Subject:  206. What's the format of an .OBJ file? (rev: 24 Mar 1994)
  719.  
  720.     - base .OBJ format:  Intel's document number #121748-001, {8086
  721.       Relocatable Object Module Formats}.  (not verified)
  722.  
  723.     Both Microsoft and Borland have extended the .OBJ format, as has IBM
  724.     for OS/2; and according to the MS-DOS encyclopedia, Microsoft
  725.     doesn't actually use all the listed formats.
  726.  
  727.     - Microsoft-specific .OBJ formats:
  728.  
  729.       * The .OBJ format document dated 14 Dec 1992, a WinHelp file from
  730.         the Microsoft developer's CD-ROM (266K after unzipping), is
  731.         downloadable as
  732.  
  733.         /vendor/microsoft/developer-network/ctech/11-9.zip from
  734.             ftp.uu.net.
  735.  
  736.       * A 45-page article can be found in the {MS-DOS Encyclopedia},
  737.         ISBN 1-55615-049-0, now out of print.
  738.  
  739.       * "Microsoft Object Module Format (OMF)" Specification, 22 Nov
  740.         1991, was published by the Microsoft Languages Group.  (not
  741.         verified)
  742.  
  743.     - Borland-specific .OBJ formats:  Open Architecture Handbook.  The
  744.       Borland Developer's Technical Guide, 1991, no ISBN.  Chapter 2,
  745.       "Object file contents", (pages 27-50) covers the comment records
  746.       sent to the object file by Borland C++ version 3.0 and other
  747.       Borland compilers.  The comment records mostly contain information
  748.       for the Borland debugger. (not verified)
  749.  
  750.     - A "tutorial on the .OBJ format" comes with the VAL experimental
  751.       linker, downloadable as
  752.  
  753.         /pub/msdos/pgmutil/val-link.zip at SimTel
  754.         /pc/assembler/linker.zoo at Garbo.
  755.  
  756.       Despite such different names, those files have the same contents,
  757.       but their contents are dated 18 Feb 1989.  You'd be better off
  758.       with one of the more recent references listed above.
  759.  
  760. Subject:  207. What's the format of an .EXE header?
  761.  
  762.     See PC Magazine 30 June 1992 (xi:12) pages 349-350 for the old and
  763.     new formats.  For a more detailed layout, look under INT 21 AH=4B in
  764.     Ralf Brown's interrupt list (Q C03).  That list includes extensions
  765.     for Borland's TLINK and Borland debugger info.
  766.  
  767.     Among the books that detail formats of executable files are {DOS
  768.     Programmer's Reference: 2d Edition} by Terry Dettman and Jim Kyle,
  769.     ISBN 0-88022-458-4; and {Microsoft MS-DOS Programmer's Reference},
  770.     ISBN 1-55615-329-5.
  771.  
  772. Subject:  208. What's the difference between .COM and .EXE formats?
  773.  
  774.     To oversimplify:  a .COM file is a direct image of core, and an .EXE
  775.     file will undergo some further relocation when it is run (and so it
  776.     begins with a relocation header).  A .COM file is limited to 64K for
  777.     all segments combined, but an .EXE file can have as many segments as
  778.     your linker will handle and be as large as RAM can take.
  779.  
  780.     The actual file extension doesn't matter.  DOS knows that a file
  781.     being loaded is in .EXE format if its first two bytes are MZ or ZM;
  782.     otherwise it is assumed to be in .COM format.  For instance, DR-DOS
  783.     6.0's COMMAND.COM is in .EXE format.
  784.  
  785.  
  786. section 3. Keyboard
  787. ===================
  788.  
  789. Subject:  301. How can I read a character without echoing it to the
  790.                screen, and without waiting for the user to press the
  791.                Enter key?
  792.  
  793.     The C compilers from Microsoft and Borland offer getch() (or
  794.     getche() to echo the character); Turbo Pascal has ReadKey.
  795.  
  796.     In other programming languages, execute INT 21 AH=8; AL is returned
  797.     with the character from standard input (possibly redirected).  If
  798.     you don't want to allow redirection, or you want to capture Ctrl-C
  799.     and other special keys, use INT 16 AH=10; this will return the scan
  800.     code in AH and ASCII code (if possible) in AL, but  AL=E0 with AH
  801.     nonzero indicates that one of the grey "extended" keys was pressed.
  802.     (If your BIOS doesn't support the extended keyboard, use INT 16 AH=0
  803.     not 10.)
  804.  
  805. Subject:  302. How can I find out whether a character has been typed,
  806.                without waiting for one?
  807.  
  808.     In Turbo Pascal, use KeyPressed.  Both Microsoft C and Turbo C offer
  809.     the kbhit() function.  All of these tell you whether a key has been
  810.     pressed.  If no key has been pressed, they return that information
  811.     to your program.  If a keystroke is waiting, they tell your program
  812.     that but leave the key in the input buffer.
  813.  
  814.     You can use the BIOS call, INT 16 AH=01 or 11, to check whether an
  815.     actual keystroke is waiting; or the DOS call, INT 21 AH=0B, to check
  816.     for a keystroke from stdin (subject to redirection).  See Ralf
  817.     Brown's interrupt list (Q C03).
  818.  
  819. Subject:  303. How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del?
  820.                (rev: 11 Sep 1993)
  821.  
  822.     Several utilities are downloadable from /pub/msdos/keyboard at
  823.     SimTel.  In that directory, cadel.zip contains a TSR (with source
  824.     code) to disable those keys.  Also, keykill.arc contains two
  825.     utilities:  keykill.com lets you disable up to three keys of your
  826.     choice, and deboot.com changes the boot key to leftShift-Alt-Del.
  827.  
  828.     C programmers who simply want to make sure that the user can't Ctrl-
  829.     Break out of their program can use the ANSI-standard signal()
  830.     function; the Borland compilers also offer ctrlbrk() for handling
  831.     Ctrl-Break.  However, if your program uses normal DOS input such as
  832.     getch(), ^C will appear on the screen when the user presses Ctrl-C
  833.     or Ctrl-Break.  You can avoid the ^C echo for Ctrl-C by using
  834.     _bios_keybrd() in MSC or bioskey() in BC++; however, Ctrl-Break will
  835.     still terminate the program.
  836.  
  837.     An alternative approach involves programming input at a lower level.
  838.     You can use INT 21 AH=7, which allows redirection but doesn't echo
  839.     the ^C (or any other character, for that matter); or use INT 16 AH=0
  840.     or 10; or hook INT 9 to discard Ctrl-C and Ctrl-Break before the
  841.     regular BIOS keyboard handler sees them; etc., etc.
  842.  
  843.     You should be aware that Ctrl-C and Ctrl-Break are processed quite
  844.     differently internally.  Ctrl-Break, like all keystrokes, is
  845.     processed by the BIOS code at INT 9 as soon as the user presses the
  846.     keys, even if earlier keys are still in the keyboard buffer:  by
  847.     default the handler at INT 1B is called.  Ctrl-C is not special to
  848.     the BIOS, nor is it special to DOS functions 6 and 7; it _is_
  849.     special to DOS functions 1 and 8 when at the head of the keyboard
  850.     buffer.  You will need to make sure BREAK is OFF to prevent DOS
  851.     polling the keyboard for Ctrl-C during non-keyboard operations.
  852.  
  853.     Some good general references are {Advanced MS-DOS} by Ray Duncan,
  854.     ISBN 1-55615-157-8; {8088 Assembler Language Programming:  The IBM
  855.     PC}, ISBN 0-672-22024-5, by Willen & Krantz; and {COMPUTE!'s Mapping
  856.     the IBM PC}, ISBN 0-942386-92-2.
  857.  
  858. Subject:  304. How can I disable the print screen function?
  859.  
  860.     There are really two print screen functions:  1) print current
  861.     screen snapshot, triggered by PrintScreen or Shift-PrtSc or Shift-
  862.     grey*, and 2) turn on continuous screen echo, started and stopped by
  863.     Ctrl-P or Ctrl-PrtSc.
  864.  
  865.     1) Screen snapshot to printer
  866.  
  867.     The BIOS uses INT 5 for this.  Fortunately, you don't need to mess
  868.     with that interrupt handler.  The standard handler, in BIOS versions
  869.     dated December 1982 or later, uses a byte at 0040:0100 (= 0000:0500)
  870.     to determine whether a print screen is currently in progress.  If it
  871.     is, pressing PrintScreen again is ignored.  So to disable the screen
  872.     snapshot, all you have to do is write a 1 to that byte.  When the
  873.     user presses PrintScreen, the BIOS will think that a print screen is
  874.     already in progress and will ignore the user's keypress.  You can re-
  875.     enable PrintScreen by zeroing the same byte.
  876.  
  877.     Here's some simple code:
  878.  
  879.         void prtsc_allow(int allow) /* 0=disable, nonzero=enable */ {
  880.             unsigned char far* flag = (unsigned char far*)0x00400100UL;
  881.             *flag = (unsigned char)!allow;
  882.         }
  883.  
  884.     2) Continuous echo of screen to printer
  885.  
  886.     If ANSI.SYS is loaded, you can easily disable the continuous echo of
  887.     screen to printer (Ctrl-P or Ctrl-PrtSc).  Just redefine the keys by
  888.     "printing" strings like these to the screen (BASIC print, C
  889.     printf(), Pascal Write statements, or ECHO command in batch files),
  890.     where <27> stands for the Escape character, ASCII 27:
  891.  
  892.         <27>[0;114;"Ctrl-PrtSc disabled"p
  893.         <27>[16;"^P"p
  894.  
  895.     If you haven't installed ANSI.SYS, I can't offer an easy way to
  896.     disable the echo-screen-to-printer function.
  897.  
  898.     Actually, you might not need to disable Ctrl-P and Ctrl-PrtSc.  If
  899.     your only concern is not locking up your machine, when you see the
  900.     "Abort, Retry, Ignore, Fail" prompt just press Ctrl-P again and then
  901.     press I.  As an alternative, install one of the many print spoolers
  902.     that intercept printer-status queries and always return "Printer
  903.     ready".
  904.  
  905. Subject:  305. How can my program turn NumLock (CapsLock, ScrollLock) on
  906.                or off?
  907.  
  908.     First, if you just don't want NumLock turned on when you reboot,
  909.     check your system's setups.  (Use Ctrl-Alt-Enter any time, or press
  910.     a special key like Del at boot time, or run the setup program
  911.     supplied with your system.)  Many systems now have an option in
  912.     setup to turn NumLock off at boot time.
  913.  
  914.     You need to twiddle bit 5, 6, or 4 of location 0040:0017.  Here's
  915.     some code:  lck() turns on a lock state, and unlck() turns it off.
  916.     (The status lights on some keyboards may not reflect the change.  If
  917.     yours is one, call INT 16 AH=2, "get shift status", and that may
  918.     update them.  It will certainly do no harm.)
  919.  
  920.         #define NUM_LOCK  (1 << 5)
  921.         #define CAPS_LOCK (1 << 6)
  922.         #define SCRL_LOCK (1 << 4)
  923.         void lck(int shiftype) {
  924.             char far* kbdstatus = (char far*)0x00400017UL;
  925.             *kbdstatus |= (char)shiftype;
  926.         }
  927.         void unlck(int shiftype) {
  928.             char far* kbdstatus = (char far*)0x00400017UL;
  929.             *kbdstatus &= ~(char)shiftype;
  930.         }
  931.  
  932. Subject:  306. How can I speed up the keyboard's auto-repeat? (rev: 24
  933.                Mar 1994)
  934.  
  935.     The keyboard speed has two components: delay (before a key that you
  936.     hold down starts repeating) and typematic rate (the speed once the
  937.     key starts repeating).  Most BIOS versions since 1986 let software
  938.     change the delay and typematic rate by calling INT 16 AH=3, "set
  939.     typematic rate and delay"; see Ralf Brown's interrupt list (Q C03).
  940.     If you have DOS 4.0 or later, you can use the MODE CON command that
  941.     you'll find in your DOS manual.
  942.  
  943.     On 83-key keyboards (mostly XTs), the delay and typematic rate can't
  944.     easily be changed.  According to PC Magazine 15 Jan 1991 (x:1) page
  945.     409, to adjust the typematic rate you need "a memory-resident
  946.     program which simply '[watches]' the keyboard to see if you're
  947.     holding down a key ... and after a certain time [starts] stuffing
  948.     extra copies of the held-down key into the buffer."  No source code
  949.     is given in that issue; but the QUICKEYS utility that PC Magazine
  950.     published in 1986 does this sort of watching (not verified); source
  951.     and object code are downloadable in
  952.  
  953.         /pub/msdos/pcmag/vol5n05.zip from SimTel.
  954.  
  955. Subject:  307. What is the SysRq key for?
  956.  
  957.     There is no standard use for the key.  The BIOS keyboard routines in
  958.     INT 16 simply ignore it; therefore so do the DOS input routines in
  959.     INT 21 as well as the keyboard routines in libraries supplied with
  960.     high-level languages.
  961.  
  962.     When you press or release a key, the keyboard triggers hardware line
  963.     IRQ1, and the CPU calls INT 9.  INT 9 reads the scan code from the
  964.     keyboard and the shift states from the BIOS data area.
  965.  
  966.     What happens next depends on whether your PC's BIOS supports an
  967.     enhanced keyboard (101 or 102 keys).  If so, INT 9 calls INT 15
  968.     AH=4F to translate the scan code.  If the translated scan code is 54
  969.     hex (for the SysRq key) then INT 9 calls INT 15 AH=85 and doesn't
  970.     put the keystroke into the keyboard buffer.  The default handler of
  971.     that function does nothing and simply returns.  (If your PC has an
  972.     older BIOS that doesn't support the extended keyboards, INT 15 AH=4F
  973.     is not called.  Early ATs have 84-key keyboards, so their BIOS calls
  974.     INT 15 AH=85 but not 4F.)
  975.  
  976.     Thus your program is free to use SysRq for its own purposes, but at
  977.     the cost of some programming.  You could hook INT 9, but it's
  978.     probably easier to hook INT 15 AH=85, which is called when SysRq is
  979.     pressed or released.
  980.  
  981. Subject:  308. How can my program tell what kind of keyboard is on the
  982.                system?
  983.  
  984.     Ralf Brown's Interrupt List (Q C03) includes MEMORY.LST, a detailed
  985.     breakdown by Robin Walker of the contents of the BIOS system block
  986.     that starts at 0040:0000.  Bit 4 of byte 0040:0096 is "1=enhanced
  987.     keyboard installed".  C code to test the keyboard type:
  988.  
  989.         char far *kbd_stat_byte3 = (char far *)0x00400096UL;
  990.         if (0x10 & *kbd_stat_byte3)
  991.             /* 101- or 102-key keyboard is installed */
  992.  
  993.     PC Magazine 15 Jan 1991 (x:1) suggests on page 412 that "for some
  994.     clones [the above test] is not foolproof".  If you use this method
  995.     in your program you should provide the user some way to override
  996.     this test, or at least some way to tell your program to assume a non-
  997.     enhanced keyboard.  The article suggests a different approach to
  998.     determining the type of keyboard.
  999.  
  1000. Subject:  309. How can I tell if input, output, or stderr has been
  1001.                redirected? (rev: 24 Mar 1994)
  1002.  
  1003.     Normally, input and output are associated with the console (i.e.,
  1004.     with the keyboard and the screen, respectively).  If either is not,
  1005.     you know that it has been redirected.  Some source code to check
  1006.     this is available at the usual archive sites.
  1007.  
  1008.     If you program in Turbo Pascal, you'll want this downloadable
  1009.     collection of Turbo Pascal units:
  1010.  
  1011.         /pc/ts/tspa33*.zip at Garbo
  1012.         /pub/msdos/turbopas/tspa33*.zip at SimTel.
  1013.  
  1014.     (where the * is 70, 60, 55, 50, or 40 for Turbo Pascal 7.0, 6.0,
  1015.     5.5, 5.0, or 4.0 respectively.)  Source code is not included.  Also
  1016.     see the downloadable Frequently Asked Questions files by Timo Salmi:
  1017.  
  1018.         /pc/ts/tsfaqp18.zip at Garbo
  1019.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1020.  
  1021.     If you program in C, use isatty() if your implementation has it.
  1022.     Otherwise, /pub/msdos/sysutil/is_con10.zip is downloadable from
  1023.     SimTel; it includes source code.
  1024.  
  1025.     Good references for the principles are PC Magazine 16 Apr 1991 (x:7)
  1026.     page 374; Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, or
  1027.     Ralf Brown's interrupt list (Q C03) for INT 21 AX=4400; and Terry
  1028.     Dettman and Jim Kyle's {DOS Programmer's Reference: 2d edition},
  1029.     ISBN 0-88022-458-4, pages 602-603.
  1030.  
  1031. Subject:  310. How can I increase the size of the keyboard buffer? (new:
  1032.                20 June 1993)
  1033.  
  1034.     I tested only one of the many available device drivers that do this,
  1035.     namely BUF160, which extends the keyboard buffer to 160 characters.
  1036.     It performed flawlessly for two years with MS-DOS 5 and Windows 3.1.
  1037.     It's downloadable as
  1038.  
  1039.         /pub/msdos/keyboard/buf160_6.zip at SimTel
  1040.         /pc/keyboard/buf160_6.zip at Garbo.
  1041.  
  1042. Subject:  311. How can I stuff characters into the keyboard buffer?
  1043.                (new: 15 Aug 1993)
  1044.  
  1045.     If your computer has an enhanced keyboard (see "308. How can my
  1046.     program tell what kind of keyboard is on the system?"), put the scan
  1047.     code in CH and the ASCII character in CL, then execute INT 16 AH=5.
  1048.     The return in AL is 0 for success or 1 for buffer full.
  1049.  
  1050.  
  1051. section 4. Disks and files
  1052. ==========================
  1053.  
  1054. Subject:  401. What drive was the PC booted from?
  1055.  
  1056.     Under DOS 4.0 or later, use INT 21 AX=3305.  DL is returned with an
  1057.     integer indicating the boot drive (1=A:, etc.).
  1058.  
  1059. Subject:  402. How can I boot from drive b:? (rev: 24 Mar 1994)
  1060.  
  1061.     Downloadable shareware:
  1062.  
  1063.         /pub/msdos/diskutil/boot_b.zip from SimTel
  1064.         /pc/bootutil/boot_b.zip from Garbo.
  1065.  
  1066.     The included documentation says it works by writing a new boot
  1067.     sector on a disk in your a: drive that redirects the boot to your b:
  1068.     drive.  (A similar utility is bboot.zip in the same directory at
  1069.     Garbo only.)
  1070.  
  1071.     If that doesn't work, you can always interchange your a: and b:
  1072.     drives by switching ribbon cables and changing the setup in your
  1073.     BIOS.  From an article posted 27 Jan 1993 on another newsgroup:
  1074.  
  1075.     Take the "ribbon" connector, as you call it, and switch them.  To
  1076.     double check, start at the end of the cable that connects to the
  1077.     motherboard or floppy controller.  Follow the cable until you get to
  1078.     the first connector.  Connect this to the drive you want to be b:.
  1079.     After this, there should be a few lines on the cable that get
  1080.     flipped left to right.  (On most cables, they just cut the lines and
  1081.     physically reverse them.  It should be quite obvious from looking at
  1082.     the cable.)  Anyway, the connector after the pins get flipped right
  1083.     to left is the connector for your a: drive.
  1084.  
  1085. Subject:  403. Which real and virtual disk drives are valid? (rev: 15
  1086.                Aug 1993)
  1087.  
  1088.     Use INT 21 AH=29 (parse filename).  Point DS:SI at a null-terminated
  1089.     ASCII string that contains the drive letter and a colon, point ES:DI
  1090.     at a 37-byte dummy FCB buffer, and call INT 21 AX=2900.  On return,
  1091.     AL is FF if the drive is invalid, something else if the drive is
  1092.     valid.  RAM disks and SUBSTed drives are considered valid.
  1093.  
  1094.     You can detect whether the drive is ASSIGNed by using INT 2F
  1095.     AX=0601.  To check whether the drive is SUBSTed, use INT 21 AX=4409;
  1096.     or use INT 21 AH=52 to test for both JOIN and SUBST.  See Ralf
  1097.     Brown's interrupt list (Q C03).
  1098.  
  1099.     Unfortunately, the b: drive is considered valid even on a single-
  1100.     diskette system.  You can check that special case by interrogating
  1101.     the BIOS equipment byte at 0040:0010.  Bits 7-6 contain the one less
  1102.     than the number of diskette drives, so if those bits are zero you
  1103.     know that b: is an invalid drive even though function 29 says it's
  1104.     valid.
  1105.  
  1106.     Following is some code originally posted by Doug Dougherty to test
  1107.     valid drives (treating SUBSTed and JOINed drives as valid), with my
  1108.     fix for the b: special case, tested in Borland C++ 2.0 (in the small
  1109.     model):
  1110.  
  1111.         #include <dos.h>
  1112.         #include <stdio.h>
  1113.         void drvlist(void) {
  1114.             char *s = "A:", fcb_buff[37];
  1115.             int valid;
  1116.             for (   ;  *s<='Z';  (*s)++) {
  1117.                 _SI = (unsigned) s;
  1118.                 _DI = (unsigned) fcb_buff;
  1119.                 _ES = _DS;
  1120.                 _AX = 0x2900;
  1121.                 geninterrupt(0x21);
  1122.                 valid = _AL != 0xFF;
  1123.                 if (*s == 'B'  &&  valid) {
  1124.                     char far *equipbyte = (char far *)0x00400010UL;
  1125.                     valid = (*equipbyte & (3 << 6)) != 0;
  1126.                 }
  1127.                 printf("Drive '%s' is %sa valid drive.\n",
  1128.                         s, valid ? "" : "not ");
  1129.             }
  1130.         }
  1131.  
  1132.     I translated this to MSC 7.0 and tested it in small model:
  1133.  
  1134.         #include <dos.h>
  1135.         #include <stdio.h>
  1136.         void drvlist(void) {
  1137.             char *s = "A:", fcb_buff[37], *buff=fcb_buff;
  1138.             int valid;
  1139.             for (   ;  *s<='Z';  (*s)++) {
  1140.                 __asm mov si,s      __asm mov di,buff
  1141.                 __asm mov ax,ds     __asm mov es,ax
  1142.                 __asm mov ax,0x2900 __asm int 21h
  1143.                 __asm xor ah,ah     __asm mov valid,ax
  1144.                 valid = (valid != 0xFF);
  1145.                 if (*s == 'B'  &&  valid) {
  1146.                     char far *equipbyte = (char far *)0x00400010UL;
  1147.                     valid = (*equipbyte & (3 << 6)) != 0;
  1148.                 }
  1149.                 printf("Drive '%s' is %sa valid drive.\n",
  1150.                         s, valid ? "" : "not ");
  1151.             }
  1152.         }
  1153.  
  1154. Subject:  404. How can I make my single floppy drive both a: and b:?
  1155.  
  1156.     Under any DOS since DOS 2.0, you can put the command
  1157.  
  1158.         assign b=a
  1159.  
  1160.     into your AUTOEXEC.BAT file.  Then, when you type "dir b:" you'll no
  1161.     longer get the annoying prompt to insert diskette B (and the even
  1162.     more annoying prompt to insert A the next time you type "dir a:").
  1163.  
  1164.     You may be wondering why anybody would want to do this.  Suppose you
  1165.     use two different machines, maybe one at home and one at work.  One
  1166.     of them has only a 3.5" diskette drive; the other machine has two
  1167.     drives, and b: is the 3.5" one.  You're bound to type "dir b:" on
  1168.     the first one, and get the nuisance message
  1169.  
  1170.         Insert diskette for drive B: and press any key when ready.
  1171.  
  1172.     But if you assign drive b: to point to a:, you avoid this problem.
  1173.  
  1174.     Caution:  there are a few commands, such as DISKCOPY, that will not
  1175.     work right on ASSIGNed or SUBSTed drives.  See the DOS manual for
  1176.     the full list.  Before typing one of those commands, be sure to turn
  1177.     off the mapping by typing "assign" without arguments.
  1178.  
  1179.     The DOS 5.0 manual says that ASSIGN is obsolete, and recommends the
  1180.     equivalent form of SUBST: "subst b: a:\".  Unfortunately, if this
  1181.     command is executed when a: doesn't hold a diskette, the command
  1182.     fails.  ASSIGN doesn't have this problem, so under DOS 5.0 you
  1183.     should disregard that particular bit of advice in the manual.
  1184.  
  1185. Subject:  405. How can I disable access to a drive? (new: 15 Aug 1993)
  1186.  
  1187.     Reader Eric DeVolder writes that he has made available a program to
  1188.     do this.  I haven't tried it, but it's downloadable as
  1189.  
  1190.         /pub/msdos/diskutil/rmdriv20.zip from SimTel
  1191.         /pc/sysutil/rmdriv20.zip at Garbo.
  1192.  
  1193. Subject:  406. How can a batch file test existence of a directory? (rev:
  1194.                8 Apr 1994)
  1195.  
  1196.     The standard way, which in fact is documented in the DOS manual, is
  1197.  
  1198.         if exist d:\path\nul goto found
  1199.  
  1200.     Unfortunately, this is not entirely reliable.  I found it failed in
  1201.     Pathworks (a/k/a PCSA, DEC's network that connects PCs and VAXes),
  1202.     or on a MARS box that uses an OEM version of MS-DOS 5.0.  Readers
  1203.     have reported that it gave the wrong answer on Novell networks, on
  1204.     DR-DOS, and in a DOS window under OS/2.  By "failed" I mean that it
  1205.     "found" a directory that didn't exist, or failed to find one that
  1206.     did exist, or both.
  1207.  
  1208.     There appears to be no foolproof way to use pure batch commands to
  1209.     test for existence of a directory.  The real solution is to write a
  1210.     program, which returns a value that your batch program can then test
  1211.     with an "if errorlevel".  Reader Duncan Murdoch kindly posted the
  1212.     following Turbo Pascal version:
  1213.  
  1214.         program existdir;
  1215.             { Confirms the existence of a directory given on the command
  1216.             line.  Returns errorlevel 2 on error, 1 if not found, 0 if
  1217.             found. }
  1218.  
  1219.         uses
  1220.             dos;
  1221.  
  1222.         var
  1223.             s : searchrec;
  1224.  
  1225.         begin
  1226.             if paramcount <> 1 then
  1227.             begin
  1228.                 writeln('Syntax:  EXISTDIR directory');
  1229.                 halt(2);
  1230.             end
  1231.             else
  1232.             begin
  1233.                 findfirst(paramstr(1),Directory,S);
  1234.                 while (Doserror = 0) and ((Directory and S.Attr) = 0) do
  1235.                     findnext(S);
  1236.                 if Doserror <> 0 then
  1237.                 begin
  1238.                     Writeln('Directory not found.');
  1239.                     halt(1);
  1240.                 end
  1241.                 else
  1242.                 begin
  1243.                     Writeln('Directory found.');
  1244.                     halt(0);
  1245.                 end;
  1246.             end;
  1247.         end.
  1248.  
  1249.     Timo Salmi also has a Turbo Pascal version in his Turbo Pascal FAQ,
  1250.     which is downloadable as
  1251.  
  1252.         /pc/ts/tsfaqp18.zip at Garbo
  1253.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1254.  
  1255. Subject:  407. Why won't my C program open a file with a path?
  1256.  
  1257.     You've probably got something like the following code:
  1258.  
  1259.         char *filename = "c:\foo\bar\mumble.dat";
  1260.         FILE *fptr;
  1261.         . . .
  1262.         fptr = fopen(filename, "r");
  1263.  
  1264.     The problem is that \f is a form feed, \b is a backspace, and \m is
  1265.     m.  Whenever you want a backslash in a string constant in C, you
  1266.     must use two backslashes:
  1267.  
  1268.         char *filename = "c:\\foo\\bar\\mumble.dat";
  1269.  
  1270.     This is a feature of every C compiler, because Dennis Ritchie
  1271.     designed C this way.  It's a problem only on MS-DOS systems, because
  1272.     only DOS (and Atari ST/TT running TOS) uses the backslash in
  1273.     directory paths.  But even in DOS this backslash convention applies
  1274.     _only_ to string constants in your source code.  For file and
  1275.     keyboard input at run time, \ is just a normal character, so users
  1276.     running your program would type in file specs the same way as in DOS
  1277.     commands, with single \ characters.
  1278.  
  1279.     Another possibility is to code all paths in source programs with /
  1280.     rather than \ characters:
  1281.  
  1282.         char *filename = "c:/foo/bar/mumble.dat";
  1283.  
  1284.     Ralf Brown writes, "All versions of the DOS kernel accept either
  1285.     forward or backslashes as directory separators.  I tend to use this
  1286.     form more frequently than backslashes since it is easier to type and
  1287.     read."  This applies to DOS function calls (and therefore to calls
  1288.     to the file library of every programming language), but not to DOS
  1289.     commands.
  1290.  
  1291. Subject:  408. How can I redirect printer output to a file? (rev: 16 Aug
  1292.                1993)
  1293.  
  1294.     Recommended: PRN2FILE from PC Magazine, downloadable as:
  1295.  
  1296.         /pub/msdos/printer/prn2file.zip at SimTel
  1297.         /pc/printer/prn2file.zip at Garbo.
  1298.  
  1299.     PC Magazine has given copies away as part of its utilities disks, so
  1300.     you may already have a copy.
  1301.  
  1302.     The directories mentioned above have lots of other utilities to
  1303.     redirect printer output.
  1304.  
  1305. Subject:  409. How can I redirect the output of a batch file? (rev: 24
  1306.                Mar 1994)
  1307.  
  1308.     Assuming the batch file is called batch.bat, to send its output
  1309.     (stdout) to another file, just invoke COMMAND.COM as a secondary
  1310.     command processor:
  1311.  
  1312.         command /c batch parameters_if_any >outfile
  1313.  
  1314.     Timo Salmi's notes on this and other batch tricks are downloadable:
  1315.  
  1316.         /pub/msdos/batutil/tsbat44.zip at SimTel
  1317.         /pc/ts/tsbat44.zip at Garbo.
  1318.  
  1319. Subject:  410. How can I redirect stderr? (rev: 24 Mar 1994)
  1320.  
  1321.     Use freopen(..., stderr) and then execute the desired command via
  1322.     system().  There are downloadable versions of programs to do this.
  1323.     I recommend this file, which includes TP4 source and executable:
  1324.  
  1325.         /pub/msdos/sysutil/rdstderr.zip from SimTel.
  1326.  
  1327.     A C example is downloadable as
  1328.  
  1329.         /pub/msdos/c/redirect.c from SimTel.
  1330.  
  1331.     I compiled it with MSC 7.0, and it works fine with one exception:
  1332.     Contrary to the included comments, redirected output starts writing
  1333.     at the beginning of the output file rather than appending.  That is
  1334.     easily solved by adding "fseek(stderr, 0L, SEEK_END);" after the
  1335.     freopen() call for stderr.
  1336.  
  1337. Subject:  411. How can my program open more files than DOS's limit of
  1338.                20? (rev: 12 Sep 1993)
  1339.  
  1340.     This is a summary of an article Ralf Brown posted on 8 August 1992,
  1341.     with some additions from a Microsoft tech note and information from
  1342.     Chin Huang.)
  1343.  
  1344.     DOS imposes some limits.  Once you overcome those, which is pretty
  1345.     easy, you may have to take additional measures to overcome the
  1346.     limitations built into your compiler's run-time library.
  1347.  
  1348.     1) Limitations imposed by DOS
  1349.  
  1350.     There are separate limits on files and file handles.  For example,
  1351.     DOS opens three files but five file handles:  CON (stdin, stdout,
  1352.     and stderr), AUX (stdaux), and PRN (stdprn).
  1353.  
  1354.     The limit in FILES= in CONFIG.SYS is a system-wide limit on files
  1355.     opened by all programs (including the three that DOS opens and any
  1356.     opened by TSRs); each process has a limit of 20 handles (including
  1357.     the five that DOS opens).  Example:  CONFIG.SYS has FILES=40.  Then
  1358.     program #1 will be able to open 15 file handles.  Assuming that the
  1359.     program actually does open 15 handles pointing to 15 different
  1360.     files, other programs could still open a total of 22 files (40-3-15
  1361.     = 22), though no one program could open more than 15 file handles.
  1362.  
  1363.     If you're running DOS 3.3 or later, you can increase the per-process
  1364.     limit of 20 file handles by a call to INT 21 AH=67, Set Handle
  1365.     Count.  Your program is still limited by the system-wide limit on
  1366.     open files, so you may also need to increase the FILES= value in
  1367.     your CONFIG.SYS file (and reboot).  The run-time library that you're
  1368.     using may have a fixed-size table of file handles, so you may also
  1369.     need to get source code for the module that contains the table,
  1370.     increase the table size, and recompile it.
  1371.  
  1372.     2) Limitations in Microsoft C run-time library
  1373.  
  1374.     In Microsoft C the run-time library limits you to 20 file handles.
  1375.     To change this, you must be aware of two limits:
  1376.  
  1377.     - file handles used with _open(), _read(), etc.: Edit _NFILE_ in
  1378.       CRT0DAT.ASM.
  1379.  
  1380.     - stream files used with fopen(), fread(), etc.: Edit _NFILE_ in
  1381.       _FILE.C for DOS or FILE.ASM for Windows/QuickWin.  This must not
  1382.       exceed the value of _NFILE_ in CRT0DAT.ASM.
  1383.  
  1384.     (QuickWin uses the constant _WFILE_ in CRT0DAT.ASM and WFILE.ASM for
  1385.     the maximum number of child text windows.)
  1386.  
  1387.     After changing the limits, recompile using CSTARTUP.BAT.  Microsoft
  1388.     recommends that you first read README.TXT in the same directory.
  1389.  
  1390.     3) Limitations in Borland C++ run-time library
  1391.  
  1392.     (Reader Chin Huang provided this information on 12 Sep 1993.)
  1393.  
  1394.     To increase the open file limit for a program you compile with
  1395.     Borland C++ 3.1, edit the file _NFILE.H in the include directory and
  1396.     change the _NFILE_ value.  Compile and link the modules FILES.C and
  1397.     FILES2.C from the lib directory into your program.
  1398.  
  1399. Subject:  412. How can I read, create, change, or delete the volume
  1400.                label?
  1401.  
  1402.     In DOS 5.0 (and possibly in 4.0 as well), there are actually two
  1403.     volume labels: the LABEL command reports only the first but changes
  1404.     both of them.
  1405.  
  1406.     - The traditional volume label is an entry with "volume label"
  1407.       attribute in the root directory of the disk.  The DIR, VOL, and
  1408.       LABEL commands report this volume label, and LABEL sets it.
  1409.  
  1410.     - There is a second volume label, which may be different, in the
  1411.       boot record along with the serial number. In DOS 4.0 and later,
  1412.       INT 21 AH=69 gets or sets the boot record's serial number and
  1413.       volume label together; see "413. How can I get the disk serial
  1414.       number?"  DIR and VOL ignore this volume label; the LABEL command
  1415.       doesn't report it but does set it.
  1416.  
  1417.     The rest of this answer assumes that by "volume label" you mean the
  1418.     traditional one, the one that DIR and VOL display.  Though it's a
  1419.     directory entry in the root directory, you can't change it using the
  1420.     newer DOS file-access functions (INT 21 AH=3C, 41, 43); instead, use
  1421.     the old FCB-oriented directory functions.  Specifically, you need to
  1422.     allocate a 64-byte buffer and a 41- byte extended FCB (file control
  1423.     block).  Call INT 21 AH=1A to find out whether there is a volume
  1424.     label.  If there is, AL returns 0 and you can change the label using
  1425.     DOS function 17 or delete it using DOS function 13.  If there's no
  1426.     volume label, function 1A will return FF and you can create a label
  1427.     via function 16.  Important points to notice are that ? wildcards
  1428.     are allowed but * are not; the volume label must be space filled not
  1429.     null terminated.
  1430.  
  1431.     The following MSC 7.0 code worked for me in DOS 5.0; the functions
  1432.     it uses have been around since DOS 2.0.  The function parameter is 0
  1433.     for the current disk, 1 for a:, 2 for b:, etc.  It doesn't matter
  1434.     what your current directory is; these functions always search the
  1435.     root directory for volume labels.  (I didn't try to change the
  1436.     volume label of any networked drives.)
  1437.  
  1438.         // Requires DOS.H, STDIO.H, STRING.H
  1439.         void vollabel(unsigned char drivenum) {
  1440.             static unsigned char extfcb[41], dta[64], status, *newlabel;
  1441.             int chars_got = 0;
  1442.             #define DOS(buff,func) __asm { __asm mov dx,offset buff   \
  1443.                 __asm mov ax,seg buff  __asm push ds  __asm mov ds,ax \
  1444.                 __asm mov ah,func  __asm int 21h  __asm pop ds        \
  1445.                 __asm mov status,al }
  1446.             #define getlabel(buff,prompt) newlabel = buff;  \
  1447.                 memset(newlabel,' ',11);  printf(prompt);   \
  1448.                 scanf("%11[^\n]%n", newlabel, &chars_got);  \
  1449.                 if (chars_got < 11) newlabel[chars_got] = ' ';
  1450.  
  1451.             // Set up the 64-byte transfer area used by function 1A.
  1452.             DOS(dta, 1Ah)
  1453.             // Set up an extended FCB and search for the volume label.
  1454.             memset(extfcb, 0, sizeof extfcb);
  1455.             extfcb[0] = 0xFF;           // denotes extended FCB
  1456.             extfcb[6] = 8;              // volume-label attribute bit
  1457.             extfcb[7] = drivenum;       // 1=A,2=B,...; 0=current drive
  1458.             memset(&extfcb[8], '?', 11);// wildcard *.*
  1459.             DOS(extfcb,11h)
  1460.             if (status == 0) {          // DTA has volume label's FCB
  1461.                 printf("volume label is %11.11s\n", &dta[8]);
  1462.                 getlabel(&dta[0x18],
  1463.                     "new label (\"delete\" to delete): ");
  1464.                 if (chars_got == 0)
  1465.                     printf("label not changed\n");
  1466.                 else if (strncmp(newlabel,"delete  ",11) == 0) {
  1467.                     DOS(dta,13h)
  1468.                     printf(status ? "label failed\n" :
  1469.                                     "label deleted\n");
  1470.                 }
  1471.                 else {                  // user wants to change label
  1472.                     DOS(dta,17h)
  1473.                     printf(status ? "label failed\n" :
  1474.                                     "label changed\n");
  1475.                 }
  1476.             }
  1477.             else {                      // no volume label was found
  1478.                 printf("disk has no volume label.\n");
  1479.                 getlabel(&extfcb[8], "new label (<Enter> for none): ");
  1480.                 if (chars_got > 0) {
  1481.                     DOS(extfcb,16h)
  1482.                     printf(status ? "label failed\n" :
  1483.                                     "label created\n");
  1484.                 }
  1485.             }
  1486.         }        // end function vollabel
  1487.  
  1488. Subject:  413. How can I get the disk serial number?
  1489.  
  1490.     Use INT 21.  AX=6900 gets the serial number; AX=6901 sets it.  See
  1491.     Ralf Brown's interrupt list (Q C03), or PC Magazine July 1992
  1492.     (xi:13) page 496, for details.
  1493.  
  1494.     This function also gets and sets the volume label in the boot
  1495.     record, which is not necessarily the same as "the" volume label
  1496.     displayed by the DIR, VOL, and LABEL commands.  For that volume
  1497.     label, see "412. How can I read, create, change, or delete the
  1498.     volume label?"
  1499.  
  1500. Subject:  414. What's the format of .OBJ, .EXE., .COM files?
  1501.  
  1502.     Please see "206. What's the format of an .OBJ file?"; "207. What's
  1503.     the format of an .EXE header?"; and "208. What's the difference
  1504.     between .COM and .EXE formats?"
  1505.  
  1506. Subject:  415. How can I flush the software disk cache?
  1507.  
  1508.     Please see "701. How can a program reboot my PC?"
  1509.  
  1510.  
  1511. section 5. Serial ports (COM ports)
  1512. ===================================
  1513.  
  1514. Subject:  501. How do I set my machine up to use COM3 and COM4?
  1515.  
  1516.     Unless your machine is fairly old, it's probably already set up.
  1517.     After installing the board that contains the extra COM port(s),
  1518.     check the I/O addresses in word 0040:0004 or 0040:0006.  (In DEBUG,
  1519.     type "D 40:4 L4" and remember that every word is displayed low byte
  1520.     first, so if you see "03 56" the word is 5603.)  If those addresses
  1521.     are nonzero, your PC is ready to use the ports and you don't need
  1522.     the rest of this answer.
  1523.  
  1524.     If the I/O address words in the 0040 segment are zero after you've
  1525.     installed the I/O board, you need some code to store these values
  1526.     into the BIOS data segment:
  1527.  
  1528.         0040:0004  word  I/O address of COM3
  1529.         0040:0006  word  I/O address of COM4
  1530.         0040:0011  byte (bits 3-1): number of serial ports installed
  1531.  
  1532.     The documentation with your I/O board should tell you the port
  1533.     addresses.  When you know the proper port addresses, you can add
  1534.     code to your program to store them and the number of serial ports
  1535.     into the BIOS data area before you open communications.  Or you can
  1536.     use DEBUG to create a little program to include in your AUTOEXEC.BAT
  1537.     file, using this script:
  1538.  
  1539.         n SET_ADDR.COM      <--- or a different name ending in .COM
  1540.         a 100
  1541.         mov  AX,0040
  1542.         mov  DS,AX
  1543.         mov  wo [0004],aaaa <--- replace aaaa with COM3 address or 0
  1544.         mov  wo [0006],ffff <--- replace ffff with COM4 address or 0
  1545.         and  by [0011],f1
  1546.         or   by [0011],8    <--- use number of serial ports times 2
  1547.         mov  AH,0
  1548.         int  21
  1549.                             <--- this line must be blank
  1550.         rCX
  1551.         1f
  1552.         rBX
  1553.         0
  1554.         w
  1555.         q
  1556.  
  1557. Subject:  502. How do I find the I/O address of a COM port? (rev: 24 Mar
  1558.                1994)
  1559.  
  1560.     Look in the four words beginning at 0040:0000 for COM1 through COM4.
  1561.     (The DEBUG command "D 40:0 L8" will do this.  Remember that words
  1562.     are stored and displayed low byte first, so a word value of 03F8
  1563.     will be displayed as F8 03.)  If the value is zero, that COM port is
  1564.     not installed (or you've got an old BIOS; see "501. How do I set my
  1565.     machine up to use COM3 and COM4?").  If the value is nonzero, it is
  1566.     the I/O address of the transmit/receive register for the COM port.
  1567.     Each COM port occupies eight consecutive I/O addresses (though many
  1568.     chips use only the first seven).
  1569.  
  1570.     Here's some C code to find the I/O address:
  1571.  
  1572.         unsigned ptSel(unsigned comport) {
  1573.             unsigned io_addr;
  1574.             if (comport >= 1  &&  comport <= 4) {
  1575.                 unsigned far *com_addr = (unsigned far *)0x00400000UL;
  1576.                 io_addr = com_addr[comport-1];
  1577.             }
  1578.             else
  1579.                 io_addr = 0;
  1580.             return io_addr;
  1581.         }
  1582.  
  1583.     You might also want to explore Port Finder, downloadable as
  1584.  
  1585.         /pub/msdos/io_util/pf271.zip at SimTel
  1586.         /pub/msdos/utilities/sysutl/pf271.zip at nic.funet.fi
  1587.  
  1588.     I haven't tried it myself, but a posted article reviewed it very
  1589.     favorably and said it also lets you swap ports around.
  1590.  
  1591. Subject:  503. But aren't the COM ports always at I/O addresses 3F8,
  1592.                2F8, 3E8, and 2E8?
  1593.  
  1594.     The first two are usually right (though not always); the last two
  1595.     are different on many machines.
  1596.  
  1597. Subject:  504. How do I configure a COM port and use it to transmit
  1598.                data? (rev: 17 Sep 1993)
  1599.  
  1600.     Do you want actual code, or do you want books that explain what's
  1601.     going on?
  1602.  
  1603.     1) Source code
  1604.  
  1605.     First, check your compiler's run-time library.  Many compilers offer
  1606.     functions similar to Microsoft C's _bios_serialcom() or Borland's
  1607.     bioscom(), which may meet your needs.
  1608.  
  1609.     Second, check for downloadable resources at SimTel and Garbo.  At
  1610.     SimTel, /pub/msdos/c/pcl4c34.zip (March 1993) is described as
  1611.     "Asynchronous communications library for C"; Garbo has a whole
  1612.     /pc/comm directory.  Also, an extended example is in Borland's
  1613.     TechFax TI445, downloadable as part of
  1614.  
  1615.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  1616.         /pc/turbopas/bchelp10.zip at Garbo.
  1617.  
  1618.     Though written by Borland, much of it is applicable to other forms
  1619.     of C, and it should give you ideas for other programming languages.
  1620.  
  1621.     2) Reference books
  1622.  
  1623.     Highly recommended: Joe Campbell's {C Programmer's Guide to Serial
  1624.     Communications}, ISBN 0-672-22584-0.  He gives complete details on
  1625.     how serial ports work, along with complete programs for doing polled
  1626.     or interrupt-driver I/O.  The book is quite thick, and none of it
  1627.     looks like filler.
  1628.  
  1629.     If Campbell's book is overkill for you, you'll find a good short
  1630.     description of serial I/O in {DOS 5: A Developer's Guide}, ISBN
  1631.     1-55851-177-6, by Al Williams.
  1632.  
  1633.     Finally, a reader has recommended {Serial Communications Programming
  1634.     in C/C++} by Mark Goodwin (ISBN 1558281983), with source code in the
  1635.     book and on disk.  Topics include the basics, various methods of
  1636.     serial communications on the PC (with consideration of high-speed
  1637.     modems), ANSI screen interface, file transfer protocols (Xmodem and
  1638.     Ymodem), etc.  There is code in C, and that code is extended into a
  1639.     C++ class for those who use C++.  There are also subroutines in
  1640.     Assembly.
  1641.  
  1642.     3) Downloadable information files
  1643.  
  1644.     A "Serial Port FAQ" is occasionally posted to this newsgroup, and is
  1645.     downloadable as multiple files:
  1646.  
  1647.         /pub/usenet/comp.os.msdos.programmer/T_S_P*_3 from rtfm.mit.edu
  1648.         /pub/E-Technik/afd/*Serial* from pfsparc02.phil15.uni-sb.de.
  1649.  
  1650.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  1651.     archived?"
  1652.  
  1653.     (The uni-sb.de archive administrator warns that the ftp address may
  1654.     change, sometime in the future, to etcip1.ee.uni-sb.de.)
  1655.  
  1656.  
  1657. section 6. Other hardware questions and problems
  1658. ================================================
  1659.  
  1660. Subject:  601. Which 80x86 CPU is running my program? (rev: 24 Mar 1994)
  1661.  
  1662.     According to an article posted by Michael Davidson, Intel's approved
  1663.     code for distinguishing among 8086, 80286, 80386, and 80486 and for
  1664.     detecting the presence of an 80287 or 80387 is published in Intel's
  1665.     486SX processor manual (order number 240950-001).  David
  1666.     Kirschbaum's improved version of this is downloadable as
  1667.  
  1668.         /pub/msdos/sysinfo/cpuid593.zip from SimTel
  1669.         /pc/sysinfo/cpuid593.zip from Garbo.
  1670.  
  1671.     According to an article posted by its author, WCPU knows the
  1672.     differences between DX and SX varieties of 386 and 486 chips, and
  1673.     can detect a math coprocessor and a Pentium.  It's downloadable as
  1674.  
  1675.         /pub/msdos/sysinfo/wcpu050.zip at SimTel
  1676.         /pc/sysinfo/wcpu050.zip at Garbo.
  1677.  
  1678. Subject:  602. How can a C program send control codes to my printer?
  1679.  
  1680.     If you just fprintf(stdprn, ...), C will translate some of your
  1681.     control codes.  The way around this is to reopen the printer in
  1682.     binary mode:
  1683.  
  1684.         prn = fopen("PRN", "wb");
  1685.  
  1686.     You must use a different file handle because stdprn isn't an lvalue.
  1687.     By the way, PRN or LPT1 must not be followed by a colon in DOS 5.0.
  1688.  
  1689.     There's one special case, Ctrl-Z (ASCII 26), the DOS end-of-file
  1690.     character.  If you try to send an ASCII 26 to your printer, DOS
  1691.     simply ignores it.  To get around this, you need to reset the
  1692.     printer from "cooked" to "raw" mode.  Microsoft C users must use INT
  1693.     21 AH=44, "get/set device information".  Turbo C and Borland C++
  1694.     users can use ioctl to accomplish the same thing:
  1695.  
  1696.         ioctl(fileno(prn), 1, ioctl(fileno(prn),0) & 0xFF | 0x20, 0);
  1697.  
  1698.     An alternative approach is simply to write the printer output into a
  1699.     disk file, then copy the file to the printer with the /B switch.
  1700.  
  1701.     A third approach is to bypass DOS functions entirely and use the
  1702.     BIOS printer functions at INT 17.  If you also fprintf(stdprn,...)
  1703.     in the same program, you'll need to use fflush() to synchronize
  1704.     fprintf()'s buffered output with the BIOS's unbuffered.
  1705.  
  1706.     By the way, if you've opened the printer in binary mode from a C
  1707.     program, remember that outgoing \n won't be translated to carriage
  1708.     return/line feed.  Depending on your printer, you may need to send
  1709.     explicit \n\r sequences.
  1710.  
  1711. Subject:  603. How can I redirect printer output to a file?
  1712.  
  1713.     Please see "408. How can I redirect printer output to a file?"
  1714.  
  1715. Subject:  604. Which video adapter is installed?
  1716.  
  1717.     The technique below should work if your BIOS is not too old.  It
  1718.     uses three functions from INT 10, the BIOS video interrupt.  (If
  1719.     you're using a Borland language, you may not have to do this the
  1720.     hard way.  Look for a function called DetectGraph or something
  1721.     similar.)
  1722.  
  1723.     Set AX=1200, BL=32 and call INT 10.  If AL returns 12, you have a
  1724.     VGA.  If not, set AH=12, BL=10 and call INT 10 again.  If BL returns
  1725.     0,1,2,3, you have an EGA with 64,128,192,256K memory.  If not, set
  1726.     AH=0F and call INT 10 a third time.  If AL is 7, you have an MDA
  1727.     (original monochrome adapter) or Hercules; if not, you have a CGA.
  1728.  
  1729.     This worked when tested with a VGA, but I had no other adapter types
  1730.     to test it with.
  1731.  
  1732. Subject:  605. How do I switch to 43- or 50-line mode?
  1733.  
  1734.     /pub/msdos/screen/vidmode.zip, downloadable from SimTel, contains
  1735.     .COM utilities and .ASM source code.
  1736.  
  1737. Subject:  606. How can I find the Microsoft mouse position and button
  1738.                status?
  1739.  
  1740.     Use INT 33 AH=3, described in Ralf Brown's interrupt list (Q C03).
  1741.  
  1742.     The Windows manual says that the Logitech mouse is compatible with
  1743.     the Microsoft one, so the interrupt will probably work the same.
  1744.  
  1745.     Also, many files are downloadable from
  1746.  
  1747.         /pub/msdos/mouse/*.* at SimTel.
  1748.  
  1749. Subject:  607. How can I access a specific address in the PC's memory?
  1750.                (rev: 24 March 1994)
  1751.  
  1752.     First check the library that came with your compiler.  Many vendors
  1753.     have some variant of peek and poke functions; in Turbo Pascal use
  1754.     the pseudo-arrays Mem, MemW, and MemL.  As an alternative, you can
  1755.     construct a far pointer:  use Ptr in Turbo Pascal; MK_FP in the
  1756.     Turbo C/Borland C family and recent versions of Microsoft C; or
  1757.     FP_OFF and FP_SEG in all versions of Microsoft C.
  1758.  
  1759.     Caution:  Turbo C and Turbo C++ also have FP_OFF and FP_SEG macros,
  1760.     but they can't be used to construct a pointer.  In Borland C++ those
  1761.     macros work the same as in Microsoft C, but MK_FP is easier to use.
  1762.  
  1763.     By the way, it's not useful to talk about "portable" ways to do
  1764.     this.  Any operation that is tied to a specific memory address is
  1765.     not likely to work on another kind of machine.
  1766.  
  1767. Subject:  608. How can I read or write my PC's CMOS memory? (rev: 24 Mar
  1768.                1994)
  1769.  
  1770.     There are a great many public-domain utilities that do this.  These
  1771.     are downloadable from SimTel in directory /pub/msdos/at:
  1772.  
  1773.         cmos14.zip     5965  920817  Saves/restores CMOS to/from file
  1774.         cmoser11.zip  28323  910721  386/286 enhanced CMOS setup program
  1775.         cmosram.zip   76096  920214  Save AT/386/486 CMOS data to file
  1776.             and restore
  1777.         rom2.zip      15692  900131  Save AT and 386 CMOS data to file
  1778.             and restore
  1779.         setup21.zip   18172  880613  Setup program which modifies CMOS
  1780.             RAM
  1781.         viewcmos.zip  11068  900225  Display contents of AT CMOS RAM,
  1782.             w/C source
  1783.  
  1784.     A program to check and display CMOS memory (but not write to it) is
  1785.     downloadable as part of
  1786.  
  1787.         /pc/ts/tsutle22.zip at Garbo
  1788.         /pub/msdos/sysutil/tsutle22.zip at SimTel.
  1789.  
  1790.     Good reports of CMOS299.ZIP, available in the pc.dir directory of
  1791.     cantva.canterbury.ac.nz [132.181.30.3], have been posted.
  1792.  
  1793.     Of the above, my only experience is with CMOSRAM, which seems to
  1794.     work fine.  It contains an excellent (and witty) .DOC file that
  1795.     explains the hardware involved and gives specific recommendations
  1796.     for preventing disaster or recovering from it.  It's $5 shareware.
  1797.  
  1798.     Robert Jourdain's {Programmer's Problem Solver for the IBM PC, XT,
  1799.     and AT} has code for accessing the CMOS RAM, according to an article
  1800.     posted in this newsgroup.
  1801.  
  1802. Subject:  609. How can I access memory beyond 640K? (rev: 24 Mar 1994)
  1803.  
  1804.     PC Magazine 29 June 1993 (xii:12) pages 302-304 carry an article,
  1805.     "How DOS Programs Can Use Over 1MB of RAM".
  1806.  
  1807.  
  1808. section 7. Other software questions and problems
  1809. ================================================
  1810.  
  1811. Subject:  701. How can a program reboot my PC? (rev: 24 Mar 1994)
  1812.  
  1813.     You can generate a "cold" boot or a "warm" boot.  A cold boot is the
  1814.     same as turning the power off and on; a warm boot is the same as
  1815.     Ctrl-Alt-Del and skips the power-on self 'test.
  1816.  
  1817.     For a warm boot, store the hex value 1234 in the word at 0040:0072.
  1818.     For a cold boot, store 0 in that word.  Then, if you want to live
  1819.     dangerously, jump to address FFFF:0000.  Here's C code to do it:
  1820.  
  1821.         /* WARNING:  data loss possible */
  1822.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1823.             void (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1824.             unsigned far* type = (unsigned far*)0x00400072UL;
  1825.             *type = (want_warm ? 0x1234 : 0);
  1826.             (*boot)( );
  1827.         }
  1828.  
  1829.     What's wrong with that method?  It will boot right away, without
  1830.     closing files, flushing disk caches, etc.  If you boot without
  1831.     flushing a write-behind disk cache (if one is running), you could
  1832.     lose data or trash the file allocation table in your hard drive.
  1833.  
  1834.     There are two methods of signaling the cache to flush its buffers:
  1835.     (1) simulate a keyboard Ctrl-Alt-Del in the keystroke translation
  1836.     function of the BIOS (INT 15 AH=4F; but see notes below), and (2)
  1837.     issue a disk reset (DOS function 0D).  Most disk-cache programs hook
  1838.     one or both of those interrupts, so if you use both methods you'll
  1839.     probably be safe.
  1840.  
  1841.     When user code simulates a Ctrl-Alt-Del, one or more of the programs
  1842.     that have hooked INT 15 AH=4F can ask that the key be ignored by
  1843.     clearing the carry flag.  For example, HyperDisk does this when it
  1844.     has started but not finished a cache flush.  So if the carry flag
  1845.     comes back cleared, the boot code has to wait a couple of clock
  1846.     ticks and then try again.  (None of this matters on older machines
  1847.     whose BIOS can't support 101- or 102-key keyboards; see the
  1848.     discussion of INT 21 AH=4F in "307. What is the SysRq key for?")
  1849.  
  1850.     C code that tries to signal the disk cache (if any) to flush is
  1851.     given below.  Turbo Pascal code by Timo Salmi that does more or less
  1852.     the same job may be found at question 49 (as of this writing) in the
  1853.     Turbo Pascal FAQ in comp.lang.pascal, and is downloadable as file
  1854.     FAQPAS2.TXT, which is part of
  1855.  
  1856.         /pc/ts/tsfaqp18.zip at Garbo
  1857.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1858.  
  1859.     Here's C code that reboots after trying to signal the disk cache:
  1860.  
  1861.         #include <dos.h>
  1862.         void bootme(int want_warm)  /* arg 0 = cold boot, 1 = warm */ {
  1863.             union REGS reg;
  1864.             void    (far* boot)(void) = (void (far*)(void))0xFFFF0000UL;
  1865.             unsigned far* boottype    =     (unsigned far*)0x00400072UL;
  1866.             char     far* shiftstate  =         (char far*)0x00400017UL;
  1867.             unsigned      ticks;
  1868.             int           time_to_waste;
  1869.             /* Simulate reception of Ctrl-Alt-Del: */
  1870.             for (;;) {
  1871.                 *shiftstate |= 0x0C;    /* turn on Ctrl & Alt */
  1872.                 reg.h.ah = 0x4F;        /* see notes below */
  1873.                 reg.h.al = 0x53;        /* 0x53 = Del's scan code */
  1874.                 reg.x.cflag = 1;        /* sentinel for ignoring key */
  1875.                 int86(0x15, ®, ®);
  1876.                 /* If carry flag is still set, we've finished. */
  1877.                 if (reg.x.cflag)
  1878.                     break;
  1879.                 /* Else waste some time before trying again: */
  1880.                 reg.h.ah = 0;
  1881.                 int86(0x1A, ®, ®);/* system time into CX:DX */
  1882.                 ticks = reg.x.dx;
  1883.                 for (time_to_waste = 3;  time_to_waste > 0;  ) {
  1884.                     reg.h.ah = 0;
  1885.                     int86(0x1A, ®, ®);
  1886.                     if (ticks != reg.x.dx)
  1887.                         ticks = reg.x.dx , --time_to_waste;
  1888.                 }
  1889.             }
  1890.             /* Issue a DOS disk reset request: */
  1891.             reg.h.ah = 0x0D;
  1892.             int86(0x21, ®, ®);
  1893.             /* Set boot type and boot: */
  1894.             *boottype = (want_warm ? 0x1234 : 0);
  1895.             (*boot)( );
  1896.         }
  1897.  
  1898.     Reader Timo Salmi reported (26 July 1993) that the INT 15 AH=4F call
  1899.     may not work on older PCs (below AT, XT2, XT286), according to Ralf
  1900.     Brown's interrupt list (Q C03).
  1901.  
  1902.     Reader Roger Fulton reported (1 July 1993) that INT 15 AH=4F hangs
  1903.     even a modern PC "ONLY when ANSI.SYS [is] loaded high using
  1904.     EMM386.EXE.  (Other things loaded high with EMM386.EXE were OK;
  1905.     ANSI.SYS loaded high with QEMM386.SYS was OK; ANSI.SYS loaded low
  1906.     with EMM386.EXE installed was OK.)"  His solution was to use only
  1907.     the disk reset, INT 21 AH=0D, which does flush SMARTDRV, then wait
  1908.     five seconds in hopes that any other disk-caching software would
  1909.     have time to flush its queue.
  1910.  
  1911.     Reader Per Bergland reported (10 Sep 1993) that the jump to
  1912.     FFFF:0000 will not work in Windows or other protected-mode programs.
  1913.     (For example, when the above reboot code ran in a DOS session under
  1914.     Windows, a box with "waiting for system shutdown" appeared.  The PC
  1915.     hung and had to be reset by cycling power.)  His solution, which
  1916.     does a cold boot not a warm boot, is to pulse pin 0 of the 8042
  1917.     keyboard controller, which is connected to the CPU's "reset" line.
  1918.     He has tested the following code on various Compaqs, and expects it
  1919.     will work for any AT-class machine; he cautions that you must first
  1920.     flush the disk cache as indicated above.
  1921.  
  1922.             cli
  1923.         @@WaitOutReady:   ; Busy-wait until 8042 ready for new command
  1924.             in al,64h         ; read 8042 status byte
  1925.             test al,00000010b ; this bit indicates input buffer full
  1926.             jnz @@WaitOutReady
  1927.             mov al,0FEh       ; Pulse "reset" = 8042 pin 0
  1928.             out 64h,al
  1929.             ; The PC will reboot now
  1930.  
  1931. Subject:  702. How can I time events with finer resolution than the
  1932.                system clock's 55 ms (about 18 ticks a second)? (rev: 24
  1933.                Mar 1994)
  1934.  
  1935.         The following files, among others, are downloadable from SimTel:
  1936.  
  1937.         /pub/msdos/at :
  1938.         atim.zip       4783  881126  Precision program timing for AT
  1939.  
  1940.         /pub/msdos/c :
  1941.         millisec.zip  37734  911205  MSC/asm src for millisecond timing
  1942.         mschrt3.zip   53708  910605  High-res timer toolbox for MSC 5.1
  1943.         msec_12.zip    8484  920320  High-def timer v1.2 (C,ASM)
  1944.         ztimer11.zip  77625  920428  Microsecond timer for C, C++, ASM
  1945.             (also at Garbo as /pc/c/ztimer11.zip)
  1946.  
  1947.         /pub/msdos/turbo_c :
  1948.         tchrt3.zip    53436  910606  High-res timer for Turbo C 2.0
  1949.         tctimer.zip   15609  891030  High-res timing for Turbo C
  1950.             (same as /pc/c/tctimer.zoo at Garbo; both are version 1.0)
  1951.  
  1952.     For Turbo Pascal users, source and object code are downloadable in
  1953.  
  1954.         /pub/msdos/turbopas/bonus507.zip at SimTel
  1955.         /pc/turbopas/bonus507.zip at Garbo.
  1956.  
  1957.     Also see "Q: How is millisecond timing done?" in FAQPAS.TXT,
  1958.     downloadable as part of
  1959.  
  1960.         /pc/ts/tsfaqp18.zip at Garbo
  1961.         /pub/msdos/info/tsfaqp18.zip at SimTel.
  1962.  
  1963. Subject:  703. How can I find the error level of the previous program?
  1964.                (rev: 24 Mar 1994)
  1965.  
  1966.     First, which previous program are you talking about?  If your
  1967.     current program ran another one, when the child program ends its
  1968.     error level is available to the program that spawned it.  Most high-
  1969.     level languages provide a way to do this; for instance, in Turbo
  1970.     Pascal it's Lo(DosExitCode) and the high byte gives the way in which
  1971.     the child terminated.  In Microsoft C, the exit code of a
  1972.     synchronous child process is the return value of the spawn-type
  1973.     function that creates the process.
  1974.  
  1975.     If your language doesn't have a function to return the error code of
  1976.     a child process, you can use INT 21 AH=4D (get return code).  By the
  1977.     way, this will tell you the child's exit code and the manner of its
  1978.     ending (normal, Ctrl-C, critical error, or TSR).
  1979.  
  1980.     It's much trickier if the current program wants to get the error
  1981.     level of the program that ran and finished before this one started.
  1982.     G.A.Theall has published source and compiled code to do this; the
  1983.     code is downloadable as
  1984.  
  1985.         /pub/msdos/batutil/errlvl13.zip at SimTel
  1986.         /pc/batchutil/errlvl12.zip (an older version) at Garbo.
  1987.  
  1988.     (The code uses undocumented features in DOS 3.3 through 5.0.  Theall
  1989.     says in the .DOC file that the values returned under 4DOS or other
  1990.     replacements won't be right.)
  1991.  
  1992. Subject:  704. How can a program set DOS environment variables? (rev: 24
  1993.                Mar 1994)
  1994.  
  1995.     Program functions that read or write "the environment" typically
  1996.     access only the program's copy of it.  What this Q really wants to
  1997.     do is to modify the active environment, the one that is affected by
  1998.     SET commands in batch files or at the DOS prompt.  You need to do
  1999.     some programming to find the active environment, and that depends on
  2000.     the version of DOS.
  2001.  
  2002.     A fairly well-written article in PC Magazine 28 Nov 1989 (viii:20),
  2003.     pages 309-314, explains how to find the active environment, and
  2004.     includes Pascal source code.  The article hints at how to change the
  2005.     environment, and suggests creating paths longer than 128 characters
  2006.     as one application.
  2007.  
  2008.     Now as for downloadable source code, there are many possibilities.
  2009.     I looked at some of these, and liked
  2010.  
  2011.         /pub/msdos/envutil/rbsetnv1.zip at SimTel
  2012.         /pc/envutil/rbsetnv1.zip at Garbo
  2013.  
  2014.     the best.  It includes some utilities to manipulate the environment,
  2015.     with source code in C.  A newer program is
  2016.  
  2017.         /pub/msdos/batutil/strings2.zip at SimTel
  2018.         part of /pc/pcmag/vol11n22.zip at Garbo,
  2019.  
  2020.     which is the code from PC Magazine 22 Dec 1992 (xi:22).
  2021.  
  2022.     You can also use a call to INT 2E, Pass Command to Interpreter for
  2023.     Execution; see Ralf Brown's interrupt list (Q C03) for details and
  2024.     cautions.
  2025.  
  2026. Subject:  705. How can I change the switch character to - from /? (rev:
  2027.                20 Mar 1994)
  2028.  
  2029.     Under DOS 5.0 and above, you can't--not completely, anyway.  INT 21
  2030.     AX=3700, get switch character, always returns a '/' (hex 2F).  But
  2031.     the DOS commands don't even call that function: they simply hard
  2032.     code '/' as the switch character.
  2033.  
  2034.     Some history:  DOS used to let you change the switch character by
  2035.     using SWITCHAR= in CONFIG.SYS or by calling DOS function 3701.  DOS
  2036.     commands and other programs called DOS function 3700 to find out the
  2037.     switch character.  If you changed the switch character to '-' (the
  2038.     usual choice), you could then type "dir c:/c700 -p" rather than "dir
  2039.     c:\c700 /p".  Under DOS 4.0, the DOS commands ignored the switch
  2040.     character but functions 3700 and 3701 still worked and could be used
  2041.     by other programs.  Under DOS 5.0, even those functions no longer
  2042.     work, though all DOS functions still accept '/' or '\' in file
  2043.     specs.
  2044.  
  2045.     You can reactivate the functions to get and set switchar by using
  2046.     programs like SLASH.ZIP or the sample TSR called SWITCHAR in
  2047.     amisl091.zip (see "707. How can I write a TSR (terminate-stay-
  2048.     resident utility)?").  DOS commands will still use the slash, but
  2049.     non-DOS programs that call DOS function 3700 will use your desired
  2050.     switch character.  (DOS replacements like 4DOS may honor the switch
  2051.     character for internal commands.)
  2052.  
  2053.     Some readers may wonder why this is even an issue.  Making '-' the
  2054.     switch character frees up the front slash to separate names in the
  2055.     path part of a file spec.  This is easier for the ten-fingered to
  2056.     type, and it's one less difference to remember for commuters between
  2057.     DOS and Unix.  The switch character is the only issue, since all the
  2058.     INT 21 functions accept '/' or '\' to separate directory names.
  2059.  
  2060. Subject:  706. Why does my interrupt function behave strangely? (rev: 24
  2061.                Sep 1993)
  2062.  
  2063.     Interrupt service routines can be tricky, because you have to do
  2064.     some things differently from "normal" programs.  If you make a
  2065.     mistake, debugging is a pain because the symptoms may not point at
  2066.     what's wrong.  Your machine may lock up or behave erratically, or
  2067.     just about anything else can happen.  Here are some things to look
  2068.     for.  (See "707. How can I write a TSR (terminate-stay-resident
  2069.     utility)?" for general techniques that may prevent a problem.)
  2070.  
  2071.     First, did you fail to set up the registers at the start of your
  2072.     routine?  When your routine begins executing, you can count on
  2073.     having CS point to your code segment and SS:SP point to some valid
  2074.     stack (of unknown length), and that's it.  In particular, an
  2075.     interrupt service routine must set DS to DGROUP before accessing any
  2076.     data in its data segments.  (If you're writing in a high-level
  2077.     language, the compiler may generate this code for you automatically;
  2078.     check your compiler manual.  For instance, in Borland and Microsoft
  2079.     C, give your function the "interrupt" attribute.)
  2080.  
  2081.     Did you remember to turn off stack checking when compiling your
  2082.     interrupt server and any functions it calls?  The stack during the
  2083.     interrupt is not where the stack-checking code expects it to be.
  2084.     (Caution:  Some third-party libraries have stack checking compiled
  2085.     in, so you can't call them from your interrupt service routine.)
  2086.  
  2087.     Next, are you calling any DOS functions (INT 21, 25, or 26) in your
  2088.     routine?  DOS is not re-entrant.  This means that if your interrupt
  2089.     happens to be triggered while the CPU is executing a DOS function,
  2090.     calling another DOS function will wreak havoc.  (Some DOS functions
  2091.     are fully re-entrant, as noted in Ralf Brown's interrupt list (Q
  2092.     C03).  Also, your program can test, in a way too complicated to
  2093.     present here, when it's safe to call non-re-entrant DOS functions.
  2094.     See INT 28, INT 21 AH=34, and INT 21 AX=5D06 or 5D0B; and consult
  2095.     {Undocumented DOS} by Andrew Schulman.  Your program must read both
  2096.     the "InDOS flag" and the "critical error flag".)
  2097.  
  2098.     Is a function in your language library causing trouble?  Does it
  2099.     depend on some initializations done at program startup that is no
  2100.     longer available when the interrupt executes?  Does it call DOS (see
  2101.     preceding paragraph)?  For example, in both Borland and Microsoft C
  2102.     the memory-allocation functions (malloc(), etc..) call DOS functions
  2103.     and also depend on setups that they can't get at from inside an
  2104.     interrupt; so do the standard I/O functions like scanf() and
  2105.     printf().  Many other library functions have the same problem, so
  2106.     you can't use them inside an interrupt function without special
  2107.     precautions.
  2108.  
  2109.     Is your routine simply taking too long?  This can be a problem if
  2110.     you're hooking on to the timer interrupt, INT 1C or INT 8.  That
  2111.     interrupt expects to be called about every 55 ms, which is 18.2
  2112.     times a second.  Therefore your routine, plus any others hooked to
  2113.     the same interrupts, must execute in less than 55 ms.  If they use
  2114.     even a substantial fraction of that time, you'll see significant
  2115.     slowdowns of your foreground program.  A good discussion is
  2116.     downloadable as
  2117.  
  2118.         pub/msdos/SIMTEL20-mirror/info/intshare.zip at ni.funet.fi
  2119.         /pub/msdos/info/intshare.zip at SimTel.
  2120.  
  2121.     Did you forget to restore all registers at the end of your routine?
  2122.  
  2123.     Did you chain improperly to the original interrupt?  You need to
  2124.     restore the stack to the way it was upon entry to your routine, then
  2125.     do a far jump (not call) to the original interrupt service routine.
  2126.     (The process is a little different in high-level languages.)
  2127.  
  2128. Subject:  707. How can I write a TSR (terminate-stay-resident utility)?
  2129.                (rev: 24 Mar 1994)
  2130.  
  2131.     There are books, and there's code to download.
  2132.  
  2133.     First, the books:
  2134.  
  2135.     - Ray Duncan's {Advanced MS-DOS}, ISBN 1-55615-157-8, gives a brief
  2136.       checklist intended for experienced programmers.  The ISBN is for
  2137.       the second edition, through DOS 4; but check to see whether the
  2138.       DOS 6 version is available yet.
  2139.  
  2140.     - {DOS 5:  A Developer's Guide} by Al Williams, ISBN 1-55851-177-6,
  2141.       goes into a little more detail, 90 pages worth!
  2142.  
  2143.     - Pascal programmers might look at {The Ultimate DOS Programmer's
  2144.       Manual} by John Mueller and Wallace Wang, ISBN 0-8306-3534-3, for
  2145.       an extended example in mixed Pascal and assembler.
  2146.  
  2147.     - For a pure assembler treatment, check Steven Holzner's {Advanced
  2148.       Assembly Language}, ISBN 0-13-663014-6.  He has a book with the
  2149.       same title out from Brady Press, but it's about half as long as
  2150.       this one.
  2151.  
  2152.     Next, the code.  Some of it is companion code to published articles,
  2153.     which are also listed below:
  2154.  
  2155.     - The Alternate Multiplex Interrupt Specification, downloadable as
  2156.  
  2157.         /pub/msdos/info/altmpx35.zip at SimTel
  2158.         /pc/programming/altmpx35.zip at Garbo
  2159.         /afs/cs/user/ralf/pub/altmpx35.zip at cs.cmu.edu
  2160.  
  2161.     - Ralf Brown's assembly-language implementation of the spec, with
  2162.       utilities in C, is downloadable as
  2163.  
  2164.         /pub/msdos/asmutil/amisl091.zip at SimTel
  2165.         /pc/c/amisl091.zip at Garbo
  2166.         /afs/cs/user/ralf/pub/amisl091.zip at cs.cmu.edu
  2167.  
  2168.     - Douglas Boling's MASM template for a TSR is downloadable as
  2169.  
  2170.         /pub/msdos/asmutl/template.zip at SimTel.
  2171.  
  2172.     - A posted article mentions Boling's "Strategies and Techniques for
  2173.       Writing State-of-the-Art TSRs that Exploit MS-DOS 5", Microsoft
  2174.       Systems Journal, Jan-Feb 1992, Volume 7, Number 1, pages 41-59,
  2175.       with examples downloadable in
  2176.  
  2177.         /pub/msdos/msjournal/msjv7-1.zip at SimTel
  2178.  
  2179.     - code for Al Stevens's "Writing Terminate-and-Stay-Resident
  2180.       Programs", Computer Language, February 1988, pages 37-48 and March
  2181.       1988, pages 67-76 is downloadable as
  2182.  
  2183.         /pub/msdos/c/tsrc.zip at SimTel
  2184.  
  2185.     - software examples to accompany Kaare Christian's "Using Microsoft
  2186.       C Version 5.1 to Write Terminate-and-Stay-Resident Programs",
  2187.       Microsoft Systems Journal, September 1988, Volume 3, Number 5,
  2188.       pages 47-57 are downloadable as
  2189.  
  2190.         /pub/msdos/msjournal/msjv3-5.arc at SimTel
  2191.  
  2192.     Finally, there are commercial products, of which TesSeRact (for C-
  2193.     language TSRs) is one of the best known.
  2194.  
  2195. Subject:  708. How can I write a device driver?
  2196.  
  2197.     Many books answer this in detail.  Among them are {Advanced MS-DOS}
  2198.     and {DOS 5: A Developer's Guide}, cited in the preceding Q.  Michael
  2199.     Tischer's {PC System Programming}, ISBN 1-55755-036-0, has an
  2200.     extensive treatment, as does Dettman and Kyle's {DOS Programmer's
  2201.     Reference: 2d Edition}, ISBN 0-88022-458-4.  For a really in-depth
  2202.     treatment, look for a specialized book like Robert Lai's {Writing MS-
  2203.     DOS Device Drivers}, ISBN 0-201-13185-4.
  2204.  
  2205. Subject:  709. What can I use to manage versions of software? (rev: 21
  2206.                Aug 1993)
  2207.  
  2208.     A port of the Unix RCS utility is downloadable as
  2209.  
  2210.         /pub/msdos/gnuish/rcs55ax.zip (EXE and docs) from SimTel
  2211.         /pub/msdos/gnuish/rcs55as.zip (source) from SimTel
  2212.         /pc/unix/alrcs5ex.zip (EXE and docs ?) from Garbo.
  2213.  
  2214.     This version of RCS is no longer limited to one-character extensions
  2215.     on filenames (for example, .CPP and .BAS are now OK).
  2216.  
  2217.     An RCS56 is available at a number of archive sites, but it appears
  2218.     to be unauthorized.  In response to a query, Keith Petersen, SimTel
  2219.     administrator, said that RCS56 was removed from SimTel at the
  2220.     author's request because it did not contain source code and thus was
  2221.     in violation of the GNU copyleft.
  2222.  
  2223.     As for commercial software, I posted a question asking for readers'
  2224.     experiences in July 1993 and seven readers responded.  PVCS from
  2225.     Intersolv (formerly Polymake) got five positive reviews, though
  2226.     several readers commented that it's expensive; RCS from MKS got one
  2227.     positive and one negative review; Burton TLIB got one negative
  2228.     review; DRTS from ILSI got one positive review.
  2229.  
  2230. Subject:  710. What's this "null pointer assignment" after my C program
  2231.                executes? (rev: 20 Mar 1994)
  2232.  
  2233.     Somewhere in your program, you assigned a value _through_ a pointer
  2234.     without first assigning a value _to_ the pointer.  (This might have
  2235.     been something like a strcpy() or memcpy() with a pointer as its
  2236.     first argument, not necessarily an actual assignment statement.)
  2237.     Your program may look like it ran correctly, but if you get this
  2238.     message you can be certain that there's a bug somewhere.
  2239.  
  2240.     Microsoft and Borland C, as part of their exit code (after a call to
  2241.     exit() or a return from your main function), check whether the
  2242.     location 0000 in your data segment contains a different value from
  2243.     what you started with.  If so, they infer that you must have used an
  2244.     uninitialized pointer.  This implies that the message will appear at
  2245.     the end of execution of your program regardless of where the error
  2246.     actually occurred.
  2247.  
  2248.     To track down the problem, you can put exit() calls at various spots
  2249.     in the program and narrow down where the uninitialized pointer is
  2250.     being used by seeing which added exit() makes the null-pointer
  2251.     message disappear.  Or, if your program was compiled with small or
  2252.     medium models, which use 16-bit data pointers, tell the debugger to
  2253.     set a watch at location 0000 in your data segment.  (If data
  2254.     pointers are 32 bits, as in the compact and large models, a null
  2255.     pointer will overwrite the interrupt vectors at 0000:0000 and
  2256.     probably lock up your machine.)
  2257.  
  2258.     Under MSC/C++ 7.0, you can declare the undocumented library function
  2259.  
  2260.         extern _cdecl _nullcheck(void);
  2261.  
  2262.     and then sprinkle calls to _nullcheck() through your program at
  2263.     regular intervals.
  2264.  
  2265.     Borland's TechFax document TI726 discusses the null pointer
  2266.     assignment from a Borland point of view.  It's one of many documents
  2267.     downloadable as part of
  2268.  
  2269.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2270.         /pc/turbopas/bchelp10.zip at Garbo.
  2271.  
  2272. Subject:  711. How can a batch file tell whether it's being run in a DOS
  2273.                box under Windows? (new: 20 Mar 1994)
  2274.  
  2275.     When Windows 3.0 or 3.1 is running, the DOS environment will contain
  2276.     a definition of the string windir, in lower case.  That's not really
  2277.     useful, however, because the batch statement
  2278.  
  2279.         if "%windir%" == "" ...
  2280.  
  2281.     will test for an environment variable WINDIR in upper case.
  2282.  
  2283.     Your only real option is to write a program as suggested by the
  2284.     following Q, and have it return a value which your batch file can
  2285.     test via "if errorlevel".
  2286.  
  2287. Subject:  712. How can my program tell if it's running under Windows?
  2288.                (rev: 20 Mar 1994)
  2289.  
  2290.     Execute INT 2F AX=4680.  If AX returns 0, you're in Windows real
  2291.     mode or standard mode (or under the DOS shell).  Otherwise, call INT
  2292.     2F AX=1600.  If AL returns something other than 0 or 80, you're in
  2293.     Windows 386 enhanced mode.  See PC Magazine 24 Nov 1992 (xi:20)
  2294.     pages 492-493.
  2295.  
  2296.     For more information, see PC Magazine 26 May 1992 (xi:10) pages 345-
  2297.     346.  A program, WINMODE, is available as part of
  2298.  
  2299.         /pub/msdos/pcmag/vol11n10.zip at SimTel
  2300.         /pc/pcmag/vol11n10.zip at Garbo.
  2301.  
  2302.     PC Magazine 29 March 1994 (xiii:6) pages 312 and 320 published a new
  2303.     program, WINVER.  This would be in
  2304.  
  2305.         /pub/msdos/pcmag/vol13n06.zip at SimTel
  2306.         /pc/pcmag/vol13n06.zip at Garbo.
  2307.  
  2308. Subject:  713. How can a program tell whether ANSI.SYS is installed?
  2309.                (new: 20 Apr 1994)
  2310.  
  2311.     In DOS 4.0 and above, call INT 2F AX=1A00.  If the value FF is
  2312.     returned in AL, ANSI.SYS is installed.  For more information, see
  2313.     Ralf Brown's interrupt list (question C03).
  2314.  
  2315. Subject:  799. How do I copyright software that I write? (rev: 9 Sep
  2316.                1993)
  2317.  
  2318.     You can download a very comprehensive answer from the Internet.
  2319.     Terry Carroll posts a six-part Copyright FAQ to misc.legal,
  2320.     news.answers and other groups.  A short answer follows, not based on
  2321.     that article.
  2322.  
  2323.     Disclaimer: I am not a lawyer, and this is not legal advice.  Also,
  2324.     there are very likely to be differences in copyright law among
  2325.     nations.  No matter where you live, if significant money may be
  2326.     involved, get legal advice.  The following is adapted (and greatly
  2327.     condensed) from chapter 4 of the Chicago Manual of Style (13th
  2328.     edition, ISBN 0-226-10390-0).
  2329.  
  2330.     In the U.S. (at least), when you write something, you own the
  2331.     copyright.  (The exception that matters most to programmers is
  2332.     "works made for hire", i.e., code you write because your employer or
  2333.     client pays you to.  A contract, agreed in advance, can vest the
  2334.     copyright in the programmer even if an employee; otherwise the
  2335.     employer owns the copyright.)  You don't have to register the work
  2336.     with the Copyright Office unless (until) the copyright is infringed
  2337.     and you intend to bring suit; however, it is easier to recover
  2338.     damages in court if you did register the work within three months of
  2339.     publication.
  2340.  
  2341.     From paragraph 4.16 of the Chicago Manual:  "... the [copyright]
  2342.     notice consists of three parts: (1) the symbol [C-in-a-circle]
  2343.     (preferred because it also suits the requirements of the Universal
  2344.     Copyright Convention), the word 'Copyright', or the abbreviation
  2345.     'Copr.', (2) the year of first publication, and (3) the name of the
  2346.     copyright owner.  Most publishers also add the phrase 'All rights
  2347.     reserved' because it affords some protection in Central and South
  2348.     American countries ...."  Surprise: "(C)" is legally not the same as
  2349.     the C-in-a-circle, so those of us who are ASCII-bound must use the
  2350.     word or the abbreviation.
  2351.  
  2352.  
  2353. section A. Downloading
  2354. ======================
  2355.  
  2356. Subject:  A01. What are SimTel, Garbo, and wustl? (rev: 6 Apr 1994)
  2357.  
  2358.     These are three of the most popular archive sites, with a few
  2359.     bazillion files available for free downloading by ftp.  (For email
  2360.     access, see "A02. I have no ftp access.  How can I get files from
  2361.     the archives?".)  Many of the files are shareware and you're
  2362.     expected to send a payment directly to the authors if you use them
  2363.     regularly.
  2364.  
  2365.     In comp.archives.msdos.d, Samuel Ko posts a two-part "Useful MS-DOS
  2366.     Programs at SIMTEL20 and Garbo"; it's downloadable as
  2367.  
  2368.         /pub/msdos/info/useful34.zip at SimTel
  2369.         /pc/filelist/useful34.zip at Garbo
  2370.         /pub/usenet/news.answers/msdos-archives/part* at rtfm.mit.edu.
  2371.  
  2372.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2373.     archived?"
  2374.  
  2375.     A few words about file names and versions:  Many files at the
  2376.     archive sites are updated from time to time.  I verified every
  2377.     filename in this FAQ as of 24 Mar 1994 by ftp to the named sites, or
  2378.     by consulting their index files.  If you can't find a file given in
  2379.     these articles as mumble12.zip, perhaps there's a newer version; try
  2380.     mumble13.zip or mumble14.zip, or mumble*.zip if your ftp program
  2381.     supports wildcards (most do so).  Please let me know of any out-of-
  2382.     date file names.
  2383.  
  2384.     This FAQ should show both Garbo and SimTel directory and file names,
  2385.     if available, for every file mentioned for downloading.  If you see
  2386.     a listing for only one of them, it means that the file was not found
  2387.     at the other site, or that the other site's catalog shows an old
  2388.     version.
  2389.  
  2390.     Also remember that caps and lower case filenames are not
  2391.     interchangeable at most archive sites.
  2392.  
  2393.     1) SimTel = oak.oakland.edu is located at the University of
  2394.     Rochester in the USA, and there are also many mirror sites including
  2395.     wuarchive.wustl.edu, archive.orts.edu, ftp.uu.net, nic.funet.fi,
  2396.     archie.au, and nctucca.edu.tw.  For instructions, see these monthly
  2397.     articles in comp.archives.msdos.announce:
  2398.  
  2399.         How to find files in the SIMTEL20 msdos collection
  2400.         How to order SIMTEL20 files via e-mail
  2401.         How to upload files to SIMTEL20
  2402.  
  2403.     These are downloadable from SimTel as
  2404.  
  2405.         /pub/msdos/filedocs/aaaread.me
  2406.         /pub/msdos/filedocs/mailserv.inf
  2407.         /pub/msdos/filedocs/upload.inf.
  2408.  
  2409.     2) Garbo = garbo.uwasa.fi [128.214.87.1] is located at the
  2410.     University of Vaasa in Finland and maintained by Timo Salmi
  2411.     (ts@uwasa.fi) and others.  Garbo and SimTel contain many of the same
  2412.     files, but there are many differences too.  Among them: the
  2413.     directory structures differ greatly, and case is significant in
  2414.     directory and file names at Garbo.
  2415.  
  2416.     3) wustl = wuarchive.wustl.edu [128.252.135.4] mirrors, among
  2417.     others, Garbo (in /systems/ibmpc/garbo) and SimTel (in
  2418.     /systems/ibmpc/msdos).  As with any mirror site, it may lag by a day
  2419.     or two, so you may not want to try it on the same day you see an
  2420.     upload notice posted.
  2421.  
  2422.     4) others:
  2423.  
  2424.     A comprehensive list of MS-DOS archive sites is downloadable as
  2425.  
  2426.         /pc/pd2/moder35.zip at Garbo
  2427.         /pub/msdos/info/moder35.zip at SimTel.
  2428.  
  2429.     For archie.au via Telnet (different from the Archie file-finding
  2430.     mail servers):  Oceanian users should try archie.au first.  Paul
  2431.     Brooks has written to say that it "mirrors Garbo and SimTel-20 (in
  2432.     /micros/pc/simtel-20, /micros/pc/garbo) as well as many other
  2433.     archives.  Telnetting to 'archie.au' and logging on as 'archie' (no
  2434.     password) will access the Oceanic ARCHIE server." Email Craig Warren
  2435.     (ccw@archie.au) for instructions if needed.
  2436.  
  2437. Subject:  A02. I have no ftp access.  How can I get files from the
  2438.                archives? (rev: 14 June 1993)
  2439.  
  2440.     First, be sure that you have no ftp access before trying email
  2441.     methods.  (Ask your sysadmin, or a knowledgeable user at your site.)
  2442.     ftp is better for you because it's faster, and it uses less net
  2443.     resources too.
  2444.  
  2445.     When using an email server, make sure the Reply-to path in your
  2446.     message is valid.  If it's not, you'll get no reply from the server.
  2447.     Do wait a few days before assuming you're not going to get a
  2448.     response; some servers have long pending queues.  After a suitable
  2449.     wait, get your sysadmin's help to correct your reply-to, and send
  2450.     your message again.
  2451.  
  2452.     Occasionally a machine goes down for an extended period, which may
  2453.     prevent a timely reply to your message.  If you're sure your message
  2454.     bears a good reply path and you haven't got a reply in a week or so,
  2455.     you might send your message again, once.  Don't post it as an
  2456.     article in a newsgroup.
  2457.  
  2458.     For files from SimTel, see "How to order SIMTEL20 files via e-mail",
  2459.     posted monthly in comp.archives.msdos.announce; or send email
  2460.     containing only the word "help" to listserv@vm1.nodak.edu.  For
  2461.     instructions on using Garbo's email server, send a request to Timo
  2462.     Salmi at ts@uwasa.fi.
  2463.  
  2464.     The DEC Western Research Labs server will get files from any ftp
  2465.     site by ftp and then email them to you.  Send email containing
  2466.     "help" to ftpmail@decwrl.dec.com.
  2467.  
  2468. Subject:  A03. Can I get archives on CD-ROM? (rev: 24 May 1993)
  2469.  
  2470.     Copies of the SimTel MS-DOS, Macintosh and Unix-C collections (also
  2471.     of wuarchive, cica, and others) are available from Walnut Creek
  2472.     CDROM, 1547 Palos Verdes, Suite 260, Walnut Creek, CA 94596-2228,
  2473.     telephone (800) 786-9907 or +1 510 674-0783, or FAX +1 510 674-0821,
  2474.     or email rab@cdrom.com.
  2475.  
  2476.     For a catalog of disks available, send email to info@cdrom.com, or
  2477.     ftp the catalog as /cdrom/catalog from cdrom.com.
  2478.  
  2479. Subject:  A04. Where do I find program <mumble>? (rev: 7 Aug 1993)
  2480.  
  2481.     You _are_ asking about shareware, freeware, or public-domain
  2482.     programs, right?  Commercial software is not legally distributed
  2483.     through the net, in general.  (Occasionally vendors will make
  2484.     patches available, but these are useful only to upgrade software you
  2485.     already own.)
  2486.  
  2487.     That said, there are several newsgroups to help you find a program.
  2488.     comp.binaries.ibm.pc.wanted is generally the best place to ask your
  2489.     question.  Please review the guidelines in "108. What other
  2490.     technical newsgroups should I know about?"
  2491.  
  2492.     Download and check the indexes from SimTel and Garbo (see "A05. How
  2493.     can I check SimTel or Garbo before I post a request for a
  2494.     program?").  Unless what you're looking for is commercial software,
  2495.     there's a good chance it will be at one or both of those sites.  The
  2496.     Archie servers maintain directories of many (not all) ftp sites
  2497.     worldwide.  You can Telnet to a server or client to search for
  2498.     files, or perform a search by email.
  2499.  
  2500. Subject:  A05. How can I check SimTel or Garbo before I post a request
  2501.                for a program? (rev: 24 Mar 1994)
  2502.  
  2503.     SimTel and Garbo have indexes of their contents, which you can
  2504.     download and then search off line.
  2505.  
  2506.     Garbo's index file, /pc/INDEX.ZIP, contains an annotated list, often
  2507.     updated, of the MS-DOS files there.  The news file /pc/pd2/news-pd2
  2508.     contains selected news on all MS-DOS directories at Garbo.
  2509.  
  2510.     SimTel's index files, in /pub/msdos/filedocs, are updated several
  2511.     times a month.  simlist.zip contains a list in text format.  But you
  2512.     may prefer the file simindex.zip, which is comma-delimited for easy
  2513.     use with any of these search facilities:
  2514.  
  2515.     - Two downloadable search programs are simtel35.zip and
  2516.       simdir22.zip.
  2517.  
  2518.     - dBASE III or IV users can load the index from simindex.zip using
  2519.       instructions in simibm.inf and simibm.db3.
  2520.  
  2521.     - PC-FILE users should get simibm.hdr, which tells how to use
  2522.       simibm.ibm.
  2523.  
  2524. Subject:  A06. How do I download and decode a program I found? (rev: 7
  2525.                Aug 1993)
  2526.  
  2527.     See the "Starter kit" and "Beginner's guide to binaries" in
  2528.     comp.binaries.ibm.pc, usually posted on the first and 15th of every
  2529.     month.  Please wait for these articles to come around; don't post a
  2530.     request.  If you can't wait, they are downloadable from
  2531.  
  2532.         Garbo as /pc/doc-net/starter.kit and bin.man
  2533.         rtfm.mit.edu in /pub/usenet/comp.binaries.ibm.pc .  The file
  2534.             names are quite long; try look for names of the form
  2535.             *starter.kit* and *bin.man*
  2536.  
  2537.     For rtfm.mit.edu instructions, see "C06. Where are FAQ lists
  2538.     archived?"
  2539.  
  2540.     Most binaries are posted and sent through email in 'uuencode'
  2541.     format.  The starter kit contains a uudecode program to turn this
  2542.     file back into binary.  Since the uuencoded file is bigger than the
  2543.     binary, you'll save connect time if you can uudecode it and then
  2544.     download the binary file.  Remember to set file type to binary.
  2545.  
  2546. Subject:  A07. Where is UUDECODE?
  2547.  
  2548.     You can find it at SimTel and Garbo, but it's easier to take it from
  2549.     the "starter kit" mentioned in the preceding Q.
  2550.  
  2551.     If you're logged in at a Unix site, there's almost certainly a
  2552.     uudecode there:  just type "uudecode" followed by a space and the
  2553.     file name.  The binary file is 25% smaller than the uuencoded file,
  2554.     so you'll save connect time if you can uudecode it on the Unix host
  2555.     and then download the binary file.  Remember: set file type binary.
  2556.  
  2557. Subject:  A08. Why do I get errors when extracting from a ZIP file I
  2558.                downloaded? (rev: 20 Mar 1994)
  2559.  
  2560.     There are many possible causes, but two of them probably account for
  2561.     95% of all problems.
  2562.  
  2563.     1) File transmission:  You must tell the archive site to transfer
  2564.     ZIP files in binary mode.  Depending on your software, you may also
  2565.     need to set your local software to receive files in binary mode.
  2566.  
  2567.     2) Unzipping program:  Make sure you aren't using an obsolete
  2568.     version.  In <9303290853.kp28285@tacom-emh1.army.mil> on 29 Mar
  2569.     1993, Keith Petersen, SimTel administrator, wrote:  "SIMTEL20 has
  2570.     standardized on the Info-ZIP group's ZIP and UNZIP because they are
  2571.     freely distributable and they have no restrictions on exporting.
  2572.     The latest version of Info-ZIP's ZIP and UNZIP can always be found
  2573.     in directory" /pub/msdos/zip "and will always have the name 'Info-
  2574.     ZIP' in the description to make them easy to locate."  PKUNZIP
  2575.     version 1.10 may not unzip newer stuff from archive sites because
  2576.     site administrators have now embraced version 2.04.  Also see "B03.
  2577.     What's the current version of UNZIP?"
  2578.  
  2579.  
  2580. section B. Vendors and products
  2581. ===============================
  2582.  
  2583. Subject:  B01. How can I contact Borland? (rev: 6 Sep 1993)
  2584.  
  2585.     Borland has set up these email addresses.  However, none of them is
  2586.     for technical support such as help with finding your own programming
  2587.     errors and explaining compiler messages.
  2588.  
  2589.     - bp7-info@borland.com will reply to any message with 17K of info on
  2590.       Borland Pascal with Objects 7.0 and Turbo Pascal 7.0.
  2591.  
  2592.     - customer-support@borland.com is for questions about prices and
  2593.       features of products, replacing bad or missing disks, info on
  2594.       upgrades, etc.  They do not accept emailed credit-card numbers.
  2595.  
  2596.     - bugs@borland.com will take "a well-documented bug report" and send
  2597.       an automated response, but will not give you a workaround or a
  2598.       scheduled fix date or even confirm that it is or is not considered
  2599.       a bug.  "The purpose of bugs@borland.com is to improve future
  2600.       products sooner, not as a substitute for tech support channels."
  2601.  
  2602.     Email tech support is available only through Compuserve (GO BOR).
  2603.  
  2604.     Telephone support is provided through separate phone numbers for
  2605.     most products.  If you're calling from the U.S., dial (800) 841-8180
  2606.     for a recorded list of toll numbers to call.  Borland's BBS is at +1
  2607.     408 439 9096.  The surface-mail address is Technical Support
  2608.     Department, Borland International, P.O. Box 660001, Scotts Valley CA
  2609.     95067-0001, USA.
  2610.  
  2611.     You'll need to give your product's name, version, and serial number.
  2612.  
  2613.     Patches for Borland products are archived at ftp.cica.indiana.edu in
  2614.     directory /pub/pc/borland .  (I haven't verified this personally.)
  2615.  
  2616.     Borland's TechFax documents are also available for download:
  2617.  
  2618.         /pub/msdos/turbo-c/bchelp10.zip at SimTel
  2619.         /pc/turbopas/bchelp10.zip at Garbo.
  2620.  
  2621.     These documents are detailed answers to common questions about Turbo
  2622.     C and Borland C products, and aggregate several hundred Kbytes.
  2623.  
  2624. Subject:  B02. How can I contact Microsoft? (rev: 18 Sep 1993)
  2625.  
  2626.     Individual employees of Microsoft (not MicroSoft, please!) post here
  2627.     sometimes.  Their addresses all take the form person@microsoft.com.
  2628.     However, Microsoft as a company does not answer individual questions
  2629.     via email through the Internet.
  2630.  
  2631.     1) information available via anonymous ftp
  2632.  
  2633.     The company maintains an anonymous FTP server, ftp.microsoft.com.
  2634.     Effective 1 Oct 1993 the server will support "Microsoft development
  2635.     tools and advanced systems products, including Windows NT, the Win32
  2636.     SDX, the Windows 3.1 SDK, Visual C++, Visual Basic, LAN Manager, SQL
  2637.     Server, and others," according to {Microsoft Developer News} for
  2638.     September 1993.  The server contains "the complete Developer
  2639.     Knowledge Base with articles written and used by Microsoft Support
  2640.     Engineers.  You will also find device drivers, patches, code
  2641.     samples, help files, and white papers."  Readme files will "give an
  2642.     overview of the directory structure," which appears to be different
  2643.     from what was put in place in July 1993.  For further information,
  2644.     says Microsoft, call (800) 936-5300.
  2645.  
  2646.     "Microsoft Developer Network technical articles and selected sample
  2647.     code files are available ... at ftp.uu.net ... in the subdirectory
  2648.     ~ftp/vendor/microsoft/developer-network" according to {Microsoft
  2649.     Developer News} for September 1993.
  2650.  
  2651.     2) information via U.S. Mail
  2652.  
  2653.     Microsoft Product Support is at 16011 NE 36th Way, Box 97017,
  2654.     Redmond WA 98073-9717, USA.
  2655.  
  2656.     You can subscribe to the {Microsoft Developer News} by mailing a
  2657.     request to Microsoft Developer Network, P.O. Box 51812, Boulder CO
  2658.     80322-1812, U.S.A.  The nearest I can figure, this is free;
  2659.     certainly I've never paid for it or been asked to.
  2660.  
  2661.     3) tech support via modem
  2662.  
  2663.     On Compuserve, GO MICROSOFT; or call Microsoft's BBS at +1 206 936-
  2664.     6735 in the U.S., or +1 416 507-3022 in Canada.
  2665.  
  2666.     4) tech support via voice telephone lines
  2667.  
  2668.     If you want to place an order or get general pre-sales information,
  2669.     call the appropriate sales and service number:
  2670.  
  2671.         U.S. end-user sales                   (800) 426-9400
  2672.         U.S. corporate/gov't/reseller/
  2673.                  educational sales            (800) 227-4679
  2674.         Canadian sales                        (800) 568-3503
  2675.         International sales                  +1 206 936-8661
  2676.  
  2677.     For tech support you must make an ordinary long-distance phone call.
  2678.     Microsoft has separate incoming phone numbers for many products.
  2679.     Since it's your nickel, first check your documentation to see if a
  2680.     phone number is listed.  Here are phone numbers (as of 1 June 1992)
  2681.     for a few products of most interest to the readers of this group:
  2682.  
  2683.         C/C++               (206) 635-7007
  2684.         MASM                (206) 646-5109
  2685.         DOS Upgrade Users   (206) 646-5104 (for 90 days after first
  2686.             call)
  2687.         Windows Users       (206) 637-6098
  2688.  
  2689.     If you can't find the direct number any other way, call the "master"
  2690.     numbers below or the sales numbers a few paragraphs above.  You'll
  2691.     get the "voice mail phone tree from h-ll" but you'll eventually get
  2692.     to the right department.  They don't provide technical assistance,
  2693.     but a voice menu will help you find the current phone number for the
  2694.     department you need.
  2695.  
  2696.         U.S. end-user product support         (206) 454-2030
  2697.         U.S. languages support                (206) 637-7096
  2698.  
  2699. Subject:  B03. What's the current version of UNZIP? (rev: 17 Mar 1994)
  2700.  
  2701.     Since April 1993, the administrators of Garbo and SimTel have
  2702.     accepted uploads in the ZIP 2.0 format.  You can use the free Info-
  2703.     ZIP versions, or PKZIP 2.04g (not 2.04c or 2.04e).  SimTel has
  2704.     standardized on the Info-ZIP versions for several reasons, as
  2705.     explained in an article posted 29 Mar 1993 in
  2706.     comp.archives.msdos.announce.
  2707.  
  2708.     Info-ZIP versions ZIP 2.0 and UNZIP 5.1 are now current.  Those
  2709.     programs, ZIP 1.9, UNZIP 5.0, and PKZIP 2.04g all work with the same
  2710.     file formats.
  2711.  
  2712.     The primary source of the free Info-ZIP programs is at ftp.uu.net,
  2713.     directory /pub/archiving/zip; or at quest.jpl.nasa.gov, directory
  2714.     /pub.  Files are in those directories or in subdirectories as shown
  2715.     below.  The DOS executable for UNZIP is self extracting; all others
  2716.     require UNZIP 5.0 or 5.1:
  2717.  
  2718.         MSDOS/unzip51x.exe - DOS executable and doc, UNZIP 5.1
  2719.         unzip51.zip - source code for UNZIP 5.1, all platforms
  2720.         MSDOS/zip20x.zip - DOS exe and doc, ZIP without crypt support
  2721.         zip201.zip - source code for ZIP 2.0, all platforms
  2722.         MSDOS/zcryp20x.zip - DOS exe and doc, ZIP with crypt support
  2723.         zcrypt21.zip - source code for ZIP crypt support
  2724.         WINDOWS/wunz20x.zip - Windows 3.1 WIZUNZIP 2.0 exe and help file
  2725.         WINDOWS/wunz20sr.zip - Windows 3.1 WIZUNZIP 2.0 source
  2726.  
  2727.     The essential files are also available at SimTel in /pub/msdos/zip
  2728.     and at Garbo in /pc/arcers.
  2729.  
  2730.     PKZIP and PKUNZIP are shareware products of PKWARE Inc.  The current
  2731.     version is 2.04g, which is the third official version after 1.10.
  2732.     They are downloadable
  2733.  
  2734.         from PKWARE's bulletin board, +1 414 354 8670, or
  2735.         from Garbo as /pc/arcers/pkz204g.exe
  2736.         from SimTel as /pub/msdos/zip/pkz204g.exe
  2737.  
  2738.     By the way, if you want to develop your own utilities, you will find
  2739.     the ZIP 2.0 data structures described in the downloadable file
  2740.  
  2741.         /pub/msdos/zip/appnote.zip at SimTel.
  2742.  
  2743. Subject:  B04. What is the phone number for a vendor's BBS? (rev: 24 Mar
  2744.                1994)
  2745.  
  2746.     Robert Baker (rbakerpc@delphi.com) uploaded a list of 800 bulletin-
  2747.     board support numbers operated by software vendors as of August
  2748.     1993.  It is downloadable as /pub/msdos/bbslist/bbs_9308.zip from
  2749.     SimTel.
  2750.  
  2751.  
  2752. section C. More information
  2753. ===========================
  2754.  
  2755. Subject:  C01. Are there any good on-line references for PC hardware
  2756.                components? (rev: 28 July 1993)
  2757.  
  2758.     Good reports of HELPPC21 have been posted.  It is downloadable as
  2759.  
  2760.         /pub/msdos/info/helppc21.zip at SimTel
  2761.         /pc/programming/helppc21.zip at Garbo.
  2762.  
  2763.     This hypertext system contains much information on ports and other
  2764.     hardware, as well as some overlap with Ralf Brown's interrupt list
  2765.     (Q C03).  It is shareware ($25).
  2766.  
  2767. Subject:  C02. Are there any good on-line references for PC interrupts?
  2768.  
  2769.     The definitive work is Ralf Brown's interrupt list; see Q C03.
  2770.  
  2771. Subject:  C03. What and where is "Ralf Brown's interrupt list"? (rev: 5
  2772.                Apr 1994)
  2773.  
  2774.     This is megabytes of information on documented and (officially)
  2775.     undocumented BIOS and DOS interrupts, DOS tables, and interrupts
  2776.     hooked by many software packages.
  2777.  
  2778.     The interrupt list comes from cs.cmu.edu [128.2.222.173] in
  2779.     /afs/cs/user/ralf/pub (switch there with a single command) as
  2780.     inter40a.zip, inter40b.zip, and inter40c.zip; the separate file
  2781.     inter40d.zip contains utilities.  The list is also downloadable as
  2782.  
  2783.         /pub/msdos/info/inter*.zip from SimTel
  2784.         /pc/programming/inter*.zip from Garbo.
  2785.  
  2786.     These versions were uploaded in early February 1994; updates are
  2787.     announced every few months in comp.archives.msdos.announce.
  2788.  
  2789. Subject:  C04. Where can I find lex, yacc, and language grammars?
  2790.  
  2791.     The FAQ list of the comp.compilers newsgroup answers this for Basic,
  2792.     C, Pascal, and other languages.  See "C06. Where are FAQ lists
  2793.     archived?"
  2794.  
  2795. Subject:  C05. What's the best book to learn programming?
  2796.  
  2797.     Sorry, this FAQ list cannot settle religious arguments.
  2798.  
  2799.     Much of the heat over this topic arises because each person believes
  2800.     that the book that he or she learned from is the best book.  But
  2801.     different people have very different experiences of the same book.
  2802.     The only person who can tell you which is the best book for learning
  2803.     a given topic is you.
  2804.  
  2805.     Your best bet is to go to a fairly well-stocked bookstore when you
  2806.     have a couple of hours to spare.  Start at one end of the shelf and
  2807.     work your way methodically through every book that looks like it
  2808.     might cover what you want to learn.  Look at the tables of contents;
  2809.     read a page or two from each book.  Then make your decision.  If
  2810.     money is a problem, or if you're not sure of your choice, check out
  2811.     your top two or three from your library.
  2812.  
  2813. Subject:  C06. Where are FAQ lists archived? (rev: 29 Mar 1994)
  2814.  
  2815.     Very possibly the FAQ list you want is already at your site.  Check
  2816.     the newsgroup news.answers; if your site doesn't carry news.answers,
  2817.     check comp.answers, rec.answers, etc., according to the top-level
  2818.     name in the FAQ list's "home" newsgroup.  Articles are posted to the
  2819.     *.answers groups in a way that should make them last until the next
  2820.     versions are posted.  If they expire sooner at your site, you might
  2821.     want to lobby your sysadmin to treat the moderated *.answers groups
  2822.     as a special case and grant them longer expiration times than other
  2823.     groups.
  2824.  
  2825.     To ftp most FAQ lists, connect to rtfm.mit.edu, and change to
  2826.     directory /pub/usenet/news.answers.  The name of the file that you
  2827.     want is the Archive-name from the top of the article.  For instance,
  2828.     if the Archive-name is software-eng/part1 you would retrieve
  2829.     /pub/usenet/news.answers/software-eng/part1.
  2830.  
  2831.     By email (only if you have no ftp access, please), the server is
  2832.     mail-server@rtfm.mit.edu .  It accepts "send" commands that omit the
  2833.     leading "/pub/" from file names; for example:
  2834.  
  2835.         send usenet/news.answers/software-eng/part1
  2836.  
  2837.     For full instructions about the mail server, send it a message
  2838.     consisting of these two lines:
  2839.  
  2840.         help
  2841.         index
  2842.  
  2843.     Not just FAQ lists, but every article listed in the "List of
  2844.     Periodic Informational Postings" (LoPIP) can be obtained by ftp or
  2845.     email from rtfm.mit.edu.  If you have an old copy of an
  2846.     informational article, look for an "Archive-name" at the beginning;
  2847.     rtfm.mit.edu stores it under that name in /pub/usenet/news.answers.
  2848.     If the article has no Archive-name, check the first name on the
  2849.     Newsgroups line and change to that directory under /pub/usenet.
  2850.  
  2851.     Or send email >>> with valid reply-to address << to brown@ncoast.org
  2852.     and you'll receive my canned instructions (about 8K) for retrieving
  2853.     FAQ lists for most newsgroups, including a few that aren't archived
  2854.     at rtfm.mit.edu.  (This offer may be withdrawn without notice
  2855.     depending on system constraints.)
  2856.  
  2857. Subject:  C07. Where can I get the latest copy of this FAQ list? (rev:
  2858.                30 Mar 1994)
  2859.  
  2860.     You can retrieve the latest version of this list as
  2861.  
  2862.         /pub/msdos/info/faqp*.zip from SimTel
  2863.         /pc/doc-net/faqp*.zip from Garbo.
  2864.  
  2865.     Check the date before downloading, to make sure that the archived
  2866.     version is actually newer than what you have.
  2867.  
  2868.     Like most FAQ lists, this one is archived at rtfm.mit.edu and a
  2869.     number of mirror sites.  If you have ftp access, retrieve either of
  2870.     these identical files:
  2871.  
  2872.         /pub/usenet/news.answers/msdos-programmer-faq/faq
  2873.         /pub/usenet/comp.os.msdos.programmer/dos-faq
  2874.  
  2875.     If you have no ftp access, see "C06. Where are FAQ lists archived?"
  2876.     for instructions on retrieving it by email.
  2877.  
  2878. Subject:  C08. How do I use ftp? (rev: 6 Apr 1994)
  2879.  
  2880.     I was much impressed with {The Whole Internet User's Guide and
  2881.     Catalog} by Ed Krol (O'Reilly & Associates, second edition ISBN
  2882.     1-56592-063-5).  It gives lots of information on using ftp, email,
  2883.     Telnet, Archie, etc.  As a new user of ftp (January 1993), I found
  2884.     the information made me productive quickly.  (Disclosure:  Though I
  2885.     don't believe it has biased my judgment, you should know that
  2886.     O'Reilly sent me a free evaluation copy.)
  2887.  
  2888.     You may also want to look for the "Beginner's Guide to FTP", posted
  2889.     periodically in comp.binaries.ibm.pc.  You can retrieve it from
  2890.     rtfm.mit.edu (see "C06. Where are FAQ lists archived?"), in
  2891.     /pub/usenet/comp.binaries.ibm.pc, as *ftp.man*.
  2892.  
  2893.     When downloading a file by ftp, make sure you have write access to
  2894.     your working directory on your local machine, and that your disk has
  2895.     enough space to hold the files.  Also make sure that if it's a ZIP
  2896.     file or other binary file type, you set the protocol to binary
  2897.     before downloading the file.
  2898.  
  2899. (end of comp.os.msdos.programmer FAQ)
  2900. -- 
  2901. Stan Brown, Oak Road Systems                    brown@Ncoast.ORG
  2902. Can't find FAQ lists?  ftp to 'rtfm.mit.edu' and look in /pub/usenet
  2903. (or email me >>> with valid reply-to address <<< for instructions).
  2904. I can also send "newbie" information on Usenet--just ask if you want it.
  2905.  
  2906.